Pre Merge pull request !164 from LionZzzi/通用download新增json格式

This commit is contained in:
LionZzzi 2024-12-06 01:43:40 +00:00 committed by Gitee
commit 2876f8c4cf
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
80 changed files with 752 additions and 461 deletions

View File

@ -11,7 +11,7 @@ VITE_APP_BASE_API = '/dev-api'
VITE_APP_CONTEXT_PATH = '/'
# 监控地址
VITE_APP_MONITOR_ADMIN = 'http://localhost:9090/admin/applications'
VITE_APP_MONITOR_ADMIN = 'http://localhost:9090/applications'
# SnailJob 控制台地址
VITE_APP_SNAILJOB_ADMIN = 'http://localhost:8800/snail-job'

View File

@ -1,17 +0,0 @@
*.sh
node_modules
*.md
*.woff
*.ttf
.vscode
.idea
dist
/public
/docs
.husky
.local
/bin
.eslintrc.cjs
prettier.config.js
src/assets
tailwind.config.js

View File

@ -1,51 +0,0 @@
module.exports = {
env: {
browser: true,
node: true,
es6: true
},
parser: 'vue-eslint-parser',
extends: [
'plugin:vue/vue3-recommended',
'./.eslintrc-auto-import.json',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:prettier/recommended'
],
parserOptions: {
ecmaVersion: '2020',
sourceType: 'module',
project: './tsconfig.*?.json',
parser: '@typescript-eslint/parser'
},
plugins: ['vue', '@typescript-eslint', 'import', 'promise', 'node', 'prettier'],
rules: {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-this-alias': 'off',
// vue
'vue/multi-word-component-names': 'off',
'vue/valid-define-props': 'off',
'vue/no-v-model-argument': 'off',
'prefer-rest-params': 'off',
// prettier
'prettier/prettier': 'error',
'@typescript-eslint/ban-types': [
'error',
{
// 关闭空类型检查 {}
extendDefaults: true,
types: {
'{}': false,
Function: false
}
}
]
},
globals: {
DialogOption: 'readonly',
OptionType: 'readonly'
}
};

View File

@ -2,6 +2,7 @@
- 本仓库为前端技术栈 [Vue3](https://v3.cn.vuejs.org) + [TS](https://www.typescriptlang.org/) + [Element Plus](https://element-plus.org/zh-CN) + [Vite](https://cn.vitejs.dev) 版本。
- 成员项目: 基于 vben(ant-design-vue) 的前端项目 [ruoyi-plus-vben](https://gitee.com/dapppp/ruoyi-plus-vben)
- 成员项目: 基于 vben5(ant-design-vue) 的前端项目 [ruoyi-plus-vben5](https://gitee.com/dapppp/ruoyi-plus-vben5)
- 配套后端代码仓库地址
- [RuoYi-Vue-Plus 5.X(注意版本号)](https://gitee.com/dromara/RuoYi-Vue-Plus)
- [RuoYi-Cloud-Plus 2.X(注意版本号)](https://gitee.com/dromara/RuoYi-Cloud-Plus)

86
eslint.config.js Normal file
View File

@ -0,0 +1,86 @@
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import pluginVue from 'eslint-plugin-vue';
import { readFile } from 'node:fs/promises';
import prettier from 'eslint-plugin-prettier';
/**
* https://blog.csdn.net/sayUonly/article/details/123482912
* 自动导入的配置
*/
const autoImportFile = new URL('./.eslintrc-auto-import.json', import.meta.url);
const autoImportGlobals = JSON.parse(await readFile(autoImportFile, 'utf8'));
/** @type {import('eslint').Linter.Config[]} */
export default [
{
/**
* 不需要.eslintignore文件 而是在这里配置
*/
ignores: [
'*.sh',
'node_modules',
'*.md',
'*.woff',
'*.ttf',
'.vscode',
'.idea',
'dist',
'/public',
'/docs',
'.husky',
'.local',
'/bin',
'.eslintrc.cjs',
'prettier.config.js',
'src/assets',
'tailwind.config.js'
]
},
{ files: ['**/*.{js,mjs,cjs,ts,vue}'] },
{
languageOptions: {
globals: globals.browser
}
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
...pluginVue.configs['flat/essential'],
{
files: ['**/*.vue'],
languageOptions: {
parserOptions: {
parser: tseslint.parser
}
}
},
{
languageOptions: {
globals: {
// 自动导入的配置 undef
...autoImportGlobals.globals,
DialogOption: 'readonly',
LayoutSetting: 'readonly'
}
},
plugins: { prettier },
rules: {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-this-alias': 'off',
// vue
'vue/multi-word-component-names': 'off',
'vue/valid-define-props': 'off',
'vue/no-v-model-argument': 'off',
'prefer-rest-params': 'off',
// prettier
'prettier/prettier': 'error',
// 允许使用空Object类型 {}
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unused-expressions': 'off'
}
}
];

View File

@ -1,4 +1,5 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"name": "ruoyi-vue-plus",
"version": "5.2.3",
"description": "RuoYi-Vue-Plus多租户管理系统",
@ -10,7 +11,8 @@
"build:prod": "vite build --mode production",
"build:dev": "vite build --mode development",
"preview": "vite preview",
"lint:eslint": "eslint --fix --ext .ts,.js,.vue ./src ",
"lint:eslint": "eslint",
"lint:eslint:fix": "eslint --fix",
"prettier": "prettier --write ."
},
"repository": {
@ -21,71 +23,66 @@
"@element-plus/icons-vue": "2.3.1",
"@highlightjs/vue-plugin": "2.1.0",
"@vueup/vue-quill": "1.2.0",
"@vueuse/core": "10.9.0",
"@vueuse/core": "11.3.0",
"animate.css": "4.1.1",
"await-to-js": "3.0.0",
"axios": "1.6.8",
"axios": "1.7.8",
"bpmn-js": "16.4.0",
"crypto-js": "4.2.0",
"diagram-js": "12.3.0",
"didi": "9.0.2",
"echarts": "5.5.0",
"element-plus": "2.7.8",
"element-plus": "2.8.8",
"file-saver": "2.0.5",
"fuse.js": "7.0.0",
"highlight.js": "11.9.0",
"image-conversion": "^2.1.1",
"image-conversion": "2.1.1",
"js-cookie": "3.0.5",
"jsencrypt": "3.3.2",
"nprogress": "0.2.0",
"pinia": "2.1.7",
"pinia": "2.2.6",
"screenfull": "6.0.2",
"vue": "3.4.34",
"vue": "3.5.13",
"vue-cropper": "1.1.1",
"vue-i18n": "9.10.2",
"vue-router": "4.3.2",
"vue-types": "5.1.1",
"vue-json-pretty": "2.4.0",
"vue-router": "4.4.5",
"vue-types": "5.1.3",
"vxe-table": "4.5.22"
},
"devDependencies": {
"@iconify/json": "2.2.201",
"@intlify/unplugin-vue-i18n": "3.0.1",
"@eslint/js": "9.15.0",
"@iconify/json": "2.2.276",
"@types/crypto-js": "4.2.2",
"@types/file-saver": "2.0.7",
"@types/js-cookie": "3.0.6",
"@types/node": "18.18.2",
"@types/nprogress": "0.2.3",
"@typescript-eslint/eslint-plugin": "7.3.1",
"@typescript-eslint/parser": "7.3.1",
"@unocss/preset-attributify": "0.58.6",
"@unocss/preset-icons": "0.58.6",
"@unocss/preset-uno": "0.58.6",
"@unocss/preset-attributify": "0.64.1",
"@unocss/preset-icons": "0.64.1",
"@unocss/preset-uno": "0.64.1",
"@vitejs/plugin-vue": "5.0.4",
"@vue/compiler-sfc": "3.4.23",
"autoprefixer": "10.4.18",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-define-config": "2.1.0",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-vue": "9.23.0",
"eslint": "9.15.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-vue": "9.31.0",
"fast-glob": "3.3.2",
"globals": "15.12.0",
"postcss": "8.4.36",
"prettier": "3.2.5",
"sass": "1.72.0",
"typescript": "5.4.5",
"unocss": "0.58.6",
"typescript": "5.7.2",
"typescript-eslint": "8.16.0",
"unocss": "0.64.1",
"unplugin-auto-import": "0.17.5",
"unplugin-icons": "0.18.5",
"unplugin-vue-components": "0.26.0",
"unplugin-vue-setup-extend-plus": "1.0.1",
"vite": "5.2.12",
"vite": "5.4.11",
"vite-plugin-compression": "0.5.1",
"vite-plugin-svg-icons": "2.0.1",
"vitest": "1.5.0",
"vue-eslint-parser": "9.4.2",
"vue-tsc": "2.0.13"
}
}

View File

@ -51,10 +51,12 @@ export function register(data: any) {
*
*/
export function logout() {
request({
url: '/resource/sse/close',
method: 'get'
});
if (import.meta.env.VITE_APP_SSE === 'true') {
request({
url: '/resource/sse/close',
method: 'get'
});
}
return request({
url: '/auth/logout',
method: 'post'
@ -100,11 +102,11 @@ export function getInfo(): AxiosPromise<UserInfo> {
}
// 获取租户列表
export function getTenantList(): AxiosPromise<TenantInfo> {
export function getTenantList(isToken: boolean): AxiosPromise<TenantInfo> {
return request({
url: '/auth/tenant/list',
headers: {
isToken: false
isToken: isToken
},
method: 'get'
});

View File

@ -30,7 +30,7 @@ export function getOnline() {
// 删除当前在线设备
export function delOnline(tokenId: string) {
return request({
url: '/monitor/online/' + tokenId,
method: 'post'
url: '/monitor/online/myself/' + tokenId,
method: 'delete'
});
}

View File

@ -96,6 +96,6 @@ export function syncTenantPackage(tenantId: string | number, packageId: string |
export function syncTenantDict() {
return request({
url: '/system/tenant/syncTenantDict',
method: 'get',
method: 'get'
});
}

View File

@ -1,4 +1,3 @@
.el-collapse {
.collapse__title {
font-weight: 600;

View File

@ -20,7 +20,7 @@
--bpmn-panel-bar-background-color: #f5f7fa;
// ele
--brder-color: #e8e8e8
--brder-color: #e8e8e8;
}
html.dark {
--menuBg: #1d1e1f;
@ -42,25 +42,25 @@ html.dark {
--el-color-primary-light-9: #262727;
}
// vxe-table 主题
--vxe-font-color: #98989E;
--vxe-primary-color: #2C7ECF;
--vxe-icon-background-color: #98989E;
--vxe-table-font-color: #98989E;
--vxe-font-color: #98989e;
--vxe-primary-color: #2c7ecf;
--vxe-icon-background-color: #98989e;
--vxe-table-font-color: #98989e;
--vxe-table-resizable-color: #95969a;
--vxe-table-header-background-color: #28282A;
--vxe-table-header-background-color: #28282a;
--vxe-table-body-background-color: #151518;
--vxe-table-background-color: #4a5663;
--vxe-table-border-width: 1px;
--vxe-table-border-color: #37373A;
--vxe-toolbar-background-color: #37373A;
--vxe-table-border-color: #37373a;
--vxe-toolbar-background-color: #37373a;
// 工作流
--bpmn-panel-border: #37373A;
--bpmn-panel-box-shadow: #37373A;
--bpmn-panel-bar-background-color: #37373A;
--bpmn-panel-border: #37373a;
--bpmn-panel-box-shadow: #37373a;
--bpmn-panel-bar-background-color: #37373a;
// ele
--brder-color: #37373A
--brder-color: #37373a;
}
// base color

View File

@ -11,21 +11,53 @@
<script setup lang="ts">
import { RouteLocationMatched } from 'vue-router';
import usePermissionStore from '@/store/modules/permission';
const route = useRoute();
const router = useRouter();
const permissionStore = usePermissionStore();
const levelList = ref<RouteLocationMatched[]>([]);
const getBreadcrumb = () => {
// only show routes with meta.title
let matched = route.matched.filter((item) => item.meta && item.meta.title);
const first = matched[0];
let matched = [];
const pathNum = findPathNum(route.path);
// multi-level menu
if (pathNum > 2) {
const reg = /\/\w+/gi;
const pathList = route.path.match(reg).map((item, index) => {
if (index !== 0) item = item.slice(1);
return item;
});
getMatched(pathList, permissionStore.defaultRoutes, matched);
} else {
matched = route.matched.filter((item) => item.meta && item.meta.title);
}
//
if (!isDashboard(first)) {
matched = ([{ path: '/index', meta: { title: '首页' } }] as any).concat(matched);
if (!isDashboard(matched[0])) {
matched = [{ path: '/index', meta: { title: '首页' } }].concat(matched);
}
levelList.value = matched.filter((item) => item.meta && item.meta.title && item.meta.breadcrumb !== false);
};
const findPathNum = (str, char = '/') => {
let index = str.indexOf(char);
let num = 0;
while (index !== -1) {
num++;
index = str.indexOf(char, index + 1);
}
return num;
};
const getMatched = (pathList, routeList, matched) => {
let data = routeList.find((item) => item.path == pathList[0] || (item.name += '').toLowerCase() == pathList[0]);
if (data) {
matched.push(data);
if (data.children && pathList.length) {
pathList.shift();
getMatched(pathList, data.children, matched);
}
}
};
const isDashboard = (route: RouteLocationMatched) => {
const name = route && (route.name as string);
if (!name) {

View File

@ -121,6 +121,11 @@ const handleBeforeUpload = (file: any) => {
return false;
}
}
//
if (file.name.includes(',')) {
proxy?.$modal.msgError('文件名不正确,不能包含英文逗号!');
return false;
}
//
if (props.fileSize) {
const isLt = file.size / 1024 / 1024 < props.fileSize;

View File

@ -139,6 +139,10 @@ const handleBeforeUpload = (file: any) => {
proxy?.$modal.msgError(`文件格式不正确, 请上传${props.fileType.join('/')}图片格式文件!`);
return false;
}
if (file.name.includes(',')) {
proxy?.$modal.msgError('文件名不正确,不能包含英文逗号!');
return false;
}
if (props.fileSize) {
const isLt = file.size / 1024 / 1024 < props.fileSize;
if (!isLt) {

View File

@ -41,7 +41,7 @@
<el-card shadow="hover">
<template #header>
<el-row :gutter="10">
<right-toolbar v-model:showSearch="showSearch" :search="true" @query-table="handleQuery"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" :search="true" @query-table="handleQuery"></right-toolbar>
</el-row>
</template>

View File

@ -166,7 +166,7 @@ const confirm = () => {
const computedIds = (data) => {
if (data instanceof Array) {
return [...data];
return data.map(item => String(item));
} else if (typeof data === 'string') {
return data.split(',');
} else if (typeof data === 'number') {

View File

@ -1,25 +0,0 @@
{
"route": {
"dashboard": "Dashboard",
"document": "Document"
},
"login": {
"username": "Username",
"password": "Password",
"login": "Login",
"code": "Verification Code",
"copyright": ""
},
"navbar": {
"full": "Full Screen",
"language": "Language",
"dashboard": "Dashboard",
"document": "Document",
"message": "Message",
"layoutSize": "Layout Size",
"selectTenant": "Select Tenant",
"layoutSetting": "Layout Setting",
"personalCenter": "Personal Center",
"logout": "Logout"
}
}

View File

@ -6,11 +6,68 @@ export default {
},
// 登录页面国际化
login: {
selectPlaceholder: 'Please select/enter a company name',
username: 'Username',
password: 'Password',
login: 'Login',
logging: 'Logging...',
code: 'Verification Code',
copyright: ''
rememberPassword: 'Remember me',
switchRegisterPage: 'Sign up now',
rule: {
tenantId: {
required: 'Please enter your tenant id'
},
username: {
required: 'Please enter your account'
},
password: {
required: 'Please enter your password'
},
code: {
required: 'Please enter a verification code'
}
},
social: {
wechat: 'Wechat Login',
maxkey: 'MaxKey Login',
topiam: 'TopIam Login',
gitee: 'Gitee Login',
github: 'Github Login'
}
},
// 注册页面国际化
register: {
selectPlaceholder: 'Please select/enter a company name',
username: 'Username',
password: 'Password',
confirmPassword: 'Confirm Password',
register: 'Register',
registering: 'Registering...',
registerSuccess: 'Congratulations, your {username} account has been registered!',
code: 'Verification Code',
switchLoginPage: 'Log in with an existing account',
rule: {
tenantId: {
required: 'Please enter your tenant id'
},
username: {
required: 'Please enter your account',
length: 'The length of the user account must be between {min} and {max}'
},
password: {
required: 'Please enter your password',
length: 'The user password must be between {min} and {max} in length',
pattern: "Can't contain illegal characters: {strings}"
},
code: {
required: 'Please enter a verification code'
},
confirmPassword: {
required: 'Please enter your password again',
equalToPassword: 'The password entered twice is inconsistent'
}
}
},
// 导航栏国际化
navbar: {

View File

@ -2,7 +2,8 @@
import { createI18n } from 'vue-i18n';
import { LanguageEnum } from '@/enums/LanguageEnum';
import messages from '@intlify/unplugin-vue-i18n/messages';
import zh_CN from '@/lang/zh_CN';
import en_US from '@/lang/en_US';
/**
*
@ -21,7 +22,12 @@ const i18n = createI18n({
allowComposition: true,
legacy: false,
locale: getLanguage(),
messages
messages: {
zh_CN: zh_CN,
en_US: en_US
}
});
export default i18n;
export type LanguageType = typeof zh_CN;

View File

@ -1,25 +0,0 @@
{
"route": {
"dashboard": "首页",
"document": "项目文档"
},
"login": {
"username": "用户名",
"password": "密码",
"login": "登 录",
"code": "请输入验证码",
"copyright": ""
},
"navbar": {
"full": "全屏",
"language": "语言",
"dashboard": "首页",
"document": "项目文档",
"message": "消息",
"layoutSize": "布局大小",
"selectTenant": "选择租户",
"layoutSetting": "布局设置",
"personalCenter": "个人中心",
"logout": "退出登录"
}
}

View File

@ -6,12 +6,70 @@ export default {
},
// 登录页面国际化
login: {
selectPlaceholder: '请选择/输入公司名称',
username: '用户名',
password: '密码',
login: '登 录',
code: '请输入验证码',
copyright: ''
logging: '登 录 中...',
code: '验证码',
rememberPassword: '记住我',
switchRegisterPage: '立即注册',
rule: {
tenantId: {
required: '请输入您的租户编号'
},
username: {
required: '请输入您的账号'
},
password: {
required: '请输入您的密码'
},
code: {
required: '请输入验证码'
}
},
social: {
wechat: '微信登录',
maxkey: 'MaxKey登录',
topiam: 'TopIam登录',
gitee: 'Gitee登录',
github: 'Github登录'
}
},
// 注册页面国际化
register: {
selectPlaceholder: '请选择/输入公司名称',
username: '用户名',
password: '密码',
confirmPassword: '确认密码',
register: '注 册',
registering: '注 册 中...',
registerSuccess: '恭喜你,您的账号 {username} 注册成功!',
code: '验证码',
switchLoginPage: '使用已有账户登录',
rule: {
tenantId: {
required: '请输入您的租户编号'
},
username: {
required: '请输入您的账号',
length: '用户账号长度必须介于 {min} 和 {max} 之间'
},
password: {
required: '请输入您的密码',
length: '用户密码长度必须介于 {min} 和 {max} 之间',
pattern: '不能包含非法字符:{strings}'
},
code: {
required: '请输入验证码'
},
confirmPassword: {
required: '请再次输入您的密码',
equalToPassword: '两次输入的密码不一致'
}
}
},
// 导航栏国际化
navbar: {
full: '全屏',
language: '语言',

View File

@ -20,6 +20,7 @@ import useTagsViewStore from '@/store/modules/tagsView';
import IframeToggle from './IframeToggle/index.vue';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const route = useRoute();
const tagsViewStore = useTagsViewStore();
//
@ -37,6 +38,20 @@ watch(
},
{ immediate: true }
);
onMounted(() => {
addIframe()
})
watch((route) => {
addIframe()
})
function addIframe() {
if (route.meta.link) {
useTagsViewStore().addIframeView(route)
}
}
</script>
<style lang="scss" scoped>

View File

@ -98,6 +98,7 @@ import { getTenantList } from '@/api/login';
import { dynamicClear, dynamicTenant } from '@/api/system/tenant';
import { TenantVO } from '@/api/types';
import notice from './notice/index.vue';
import router from '@/router';
const appStore = useAppStore();
const userStore = useUserStore();
@ -142,7 +143,7 @@ const dynamicClearEvent = async () => {
/** 租户列表 */
const initTenantList = async () => {
const { data } = await getTenantList();
const { data } = await getTenantList(true);
tenantEnabled.value = data.tenantEnabled === undefined ? true : data.tenantEnabled;
if (tenantEnabled.value) {
tenantList.value = data.voList;
@ -163,8 +164,14 @@ const logout = async () => {
cancelButtonText: '取消',
type: 'warning'
});
await userStore.logout();
location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
userStore.logout().then(() => {
router.replace({
path: '/login',
query: {
redirect: encodeURIComponent(router.currentRoute.value.fullPath || '/')
}
});
});
};
const emits = defineEmits(['setLayout']);

View File

@ -59,11 +59,9 @@ const hasOneShowingChild = (parent: RouteRecordRaw, children?: RouteRecordRaw[])
const showingChildren = children.filter((item) => {
if (item.hidden) {
return false;
} else {
// Temp set(will be used if only has one showing child)
onlyOneChild.value = item;
return true;
}
onlyOneChild.value = item;
return true;
});
// When there is only one child router, the child router is displayed by default

View File

@ -135,11 +135,7 @@ const addTags = () => {
}
if (name) {
useTagsViewStore().addView(route as any);
if (route.meta.link) {
useTagsViewStore().addIframeView(route as any);
}
}
return false;
};
const moveToCurrentTag = () => {
nextTick(() => {

View File

@ -66,7 +66,7 @@ const closeSearch = () => {
state.isShowSearch = false;
};
//
const menuSearch = (queryString: string, cb: Function) => {
const menuSearch = (queryString: string, cb: (options: any[]) => void) => {
let options = state.menuList.filter((item) => {
return item.title.indexOf(queryString) > -1;
});

View File

@ -27,7 +27,7 @@ import { AppMain, Navbar, Settings, TagsView } from './components';
import useAppStore from '@/store/modules/app';
import useSettingsStore from '@/store/modules/settings';
import { initWebSocket } from '@/utils/websocket';
import { initSSE } from "@/utils/sse";
import { initSSE } from '@/utils/sse';
const settingsStore = useSettingsStore();
const theme = computed(() => settingsStore.theme);

View File

@ -3,14 +3,18 @@ import router from './router';
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
import { getToken } from '@/utils/auth';
import { isHttp } from '@/utils/validate';
import { isHttp, isPathMatch } from '@/utils/validate';
import { isRelogin } from '@/utils/request';
import useUserStore from '@/store/modules/user';
import useSettingsStore from '@/store/modules/settings';
import usePermissionStore from '@/store/modules/permission';
NProgress.configure({ showSpinner: false });
const whiteList = ['/login', '/register', '/social-callback'];
const whiteList = ['/login', '/register', '/social-callback', '/register*', '/register/*'];
const isWhiteList = (path: string) => {
return whiteList.some(pattern => isPathMatch(pattern, path))
}
router.beforeEach(async (to, from, next) => {
NProgress.start();
@ -20,7 +24,7 @@ router.beforeEach(async (to, from, next) => {
if (to.path === '/login') {
next({ path: '/' });
NProgress.done();
} else if (whiteList.indexOf(to.path as string) !== -1) {
} else if (isWhiteList(to.path)) {
next();
} else {
if (useUserStore().roles.length === 0) {
@ -40,7 +44,7 @@ router.beforeEach(async (to, from, next) => {
router.addRoute(route); // 动态添加可访问路由表
}
});
// @ts-ignore
// @ts-expect-error hack方法 确保addRoutes已完成
next({ path: to.path, replace: true, params: to.params, query: to.query, hash: to.hash, name: to.name as string }); // hack方法 确保addRoutes已完成
}
} else {
@ -49,7 +53,7 @@ router.beforeEach(async (to, from, next) => {
}
} else {
// 没有token
if (whiteList.indexOf(to.path as string) !== -1) {
if (isWhiteList(to.path)) {
// 在免登录白名单,直接进入
next();
} else {

View File

@ -26,6 +26,7 @@ const sessionCache = {
if (value != null) {
return JSON.parse(value);
}
return null;
},
remove(key: string) {
sessionStorage.removeItem(key);
@ -59,6 +60,7 @@ const localCache = {
if (value != null) {
return JSON.parse(value);
}
return null;
},
remove(key: string) {
localStorage.removeItem(key);

View File

@ -1,5 +1,5 @@
import router from '@/router';
import {RouteLocationMatched, RouteLocationNormalized, RouteLocationRaw} from 'vue-router';
import { RouteLocationMatched, RouteLocationNormalized, RouteLocationRaw } from 'vue-router';
import useTagsViewStore from '@/store/modules/tagsView';
export default {

View File

@ -103,7 +103,7 @@ export const dynamicRoutes: RouteRecordRaw[] = [
path: 'role/:userId(\\d+)',
component: () => import('@/views/system/user/authRole.vue'),
name: 'AuthRole',
meta: { title: '分配角色', activeMenu: '/system/user', icon: '' }
meta: { title: '分配角色', activeMenu: '/system/user', icon: '', noCache: true }
}
]
},
@ -117,7 +117,7 @@ export const dynamicRoutes: RouteRecordRaw[] = [
path: 'user/:roleId(\\d+)',
component: () => import('@/views/system/role/authUser.vue'),
name: 'AuthUser',
meta: { title: '分配用户', activeMenu: '/system/role', icon: '' }
meta: { title: '分配用户', activeMenu: '/system/role', icon: '', noCache: true }
}
]
},
@ -131,7 +131,7 @@ export const dynamicRoutes: RouteRecordRaw[] = [
path: 'index/:dictId(\\d+)',
component: () => import('@/views/system/dict/data.vue'),
name: 'Data',
meta: { title: '字典数据', activeMenu: '/system/dict', icon: '' }
meta: { title: '字典数据', activeMenu: '/system/dict', icon: '', noCache: true }
}
]
},
@ -145,7 +145,7 @@ export const dynamicRoutes: RouteRecordRaw[] = [
path: 'index',
component: () => import('@/views/system/oss/config.vue'),
name: 'OssConfig',
meta: { title: '配置管理', activeMenu: '/system/oss', icon: '' }
meta: { title: '配置管理', activeMenu: '/system/oss', icon: '', noCache: true }
}
]
},
@ -189,9 +189,8 @@ const router = createRouter({
scrollBehavior(to, from, savedPosition) {
if (savedPosition) {
return savedPosition;
} else {
return { top: 0 };
}
return { top: 0 };
}
});

View File

@ -1,29 +1,15 @@
export const useDictStore = defineStore('dict', () => {
const dict = ref<
Array<{
key: string;
value: DictDataOption[];
}>
>([]);
const dict = ref<Map<string, DictDataOption[]>>(new Map());
/**
*
* @param _key key
*/
const getDict = (_key: string): DictDataOption[] | null => {
if (_key == null && _key == '') {
if (!_key) {
return null;
}
try {
for (let i = 0; i < dict.value.length; i++) {
if (dict.value[i].key == _key) {
return dict.value[i].value;
}
}
} catch (e) {
return null;
}
return null;
return dict.value.get(_key) || null;
};
/**
@ -32,11 +18,15 @@ export const useDictStore = defineStore('dict', () => {
* @param _value value
*/
const setDict = (_key: string, _value: DictDataOption[]) => {
if (_key !== null && _key !== '') {
dict.value.push({
key: _key,
value: _value
});
if (!_key) {
return false;
}
try {
dict.value.set(_key, _value);
return true;
} catch (e) {
console.error('Error in setDict:', e);
return false;
}
};
@ -45,25 +35,22 @@ export const useDictStore = defineStore('dict', () => {
* @param _key
*/
const removeDict = (_key: string): boolean => {
let bln = false;
try {
for (let i = 0; i < dict.value.length; i++) {
if (dict.value[i].key == _key) {
dict.value.splice(i, 1);
return true;
}
}
} catch (e) {
bln = false;
if (!_key) {
return false;
}
try {
return dict.value.delete(_key);
} catch (e) {
console.error('Error in removeDict:', e);
return false;
}
return bln;
};
/**
*
*/
const cleanDict = (): void => {
dict.value = [];
dict.value.clear();
};
return {

View File

@ -158,9 +158,12 @@ export const filterDynamicRoutes = (routes: RouteRecordRaw[]) => {
export const loadView = (view: any, name: string) => {
let res;
for (const path in modules) {
const dir = path.split('views/')[1].split('.vue')[0];
const viewsIndex = path.indexOf('/views/');
let dir = path.substring(viewsIndex + 7);
dir = dir.substring(0, dir.lastIndexOf('.vue'));
if (dir === view) {
res = createCustomNameComponent(modules[path], { name });
return res;
}
}
return res;

View File

@ -31,7 +31,7 @@ export const useTagsViewStore = defineStore('tagsView', () => {
const delIframeView = (view: RouteLocationNormalized): Promise<RouteLocationNormalized[]> => {
return new Promise((resolve) => {
iframeViews.value = iframeViews.value.filter((item: RouteLocationNormalized) => item.path !== view.path);
resolve([...iframeViews.value as RouteLocationNormalized[]]);
resolve([...(iframeViews.value as RouteLocationNormalized[])]);
});
};
const addVisitedView = (view: RouteLocationNormalized): void => {
@ -54,7 +54,7 @@ export const useTagsViewStore = defineStore('tagsView', () => {
delCachedView(view);
}
resolve({
visitedViews: [...visitedViews.value as RouteLocationNormalized[]],
visitedViews: [...(visitedViews.value as RouteLocationNormalized[])],
cachedViews: [...cachedViews.value]
});
});
@ -68,7 +68,7 @@ export const useTagsViewStore = defineStore('tagsView', () => {
break;
}
}
resolve([...visitedViews.value as RouteLocationNormalized[]]);
resolve([...(visitedViews.value as RouteLocationNormalized[])]);
});
};
const delCachedView = (view?: RouteLocationNormalized): Promise<string[]> => {
@ -92,7 +92,7 @@ export const useTagsViewStore = defineStore('tagsView', () => {
delOthersVisitedViews(view);
delOthersCachedViews(view);
resolve({
visitedViews: [...visitedViews.value as RouteLocationNormalized[]],
visitedViews: [...(visitedViews.value as RouteLocationNormalized[])],
cachedViews: [...cachedViews.value]
});
});
@ -103,7 +103,7 @@ export const useTagsViewStore = defineStore('tagsView', () => {
visitedViews.value = visitedViews.value.filter((v: RouteLocationNormalized) => {
return v.meta?.affix || v.path === view.path;
});
resolve([...visitedViews.value as RouteLocationNormalized[]]);
resolve([...(visitedViews.value as RouteLocationNormalized[])]);
});
};
const delOthersCachedViews = (view: RouteLocationNormalized): Promise<string[]> => {
@ -124,7 +124,7 @@ export const useTagsViewStore = defineStore('tagsView', () => {
delAllVisitedViews();
delAllCachedViews();
resolve({
visitedViews: [...visitedViews.value as RouteLocationNormalized[]],
visitedViews: [...(visitedViews.value as RouteLocationNormalized[])],
cachedViews: [...cachedViews.value]
});
});
@ -132,7 +132,7 @@ export const useTagsViewStore = defineStore('tagsView', () => {
const delAllVisitedViews = (): Promise<RouteLocationNormalized[]> => {
return new Promise((resolve) => {
visitedViews.value = visitedViews.value.filter((tag: RouteLocationNormalized) => tag.meta?.affix);
resolve([...visitedViews.value as RouteLocationNormalized[]]);
resolve([...(visitedViews.value as RouteLocationNormalized[])]);
});
};
@ -167,7 +167,7 @@ export const useTagsViewStore = defineStore('tagsView', () => {
}
return false;
});
resolve([...visitedViews.value as RouteLocationNormalized[]]);
resolve([...(visitedViews.value as RouteLocationNormalized[])]);
});
};
const delLeftTags = (view: RouteLocationNormalized): Promise<RouteLocationNormalized[]> => {
@ -186,7 +186,7 @@ export const useTagsViewStore = defineStore('tagsView', () => {
}
return false;
});
resolve([...visitedViews.value as RouteLocationNormalized[]]);
resolve([...(visitedViews.value as RouteLocationNormalized[])]);
});
};

22
src/types/module.d.ts vendored
View File

@ -8,10 +8,11 @@ import { useDict } from '@/utils/dict';
import { handleTree, addDateRange, selectDictLabel, selectDictLabels, parseTime } from '@/utils/ruoyi';
import { getConfigKey, updateConfigByKey } from '@/api/system/config';
import { download as rd } from '@/utils/request';
import type { LanguageType } from '@/lang';
export {};
declare module 'vue' {
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
// 全局方法声明
$modal: typeof modal;
@ -20,6 +21,11 @@ declare module 'vue' {
$auth: typeof auth;
$cache: typeof cache;
animate: typeof animate;
/**
* i18n $t方法支持ts类型提示
* @param key i18n key
*/
$t(key: ObjKeysToUnion<LanguageType>): string;
useDict: typeof useDict;
addDateRange: typeof addDateRange;
@ -33,7 +39,13 @@ declare module 'vue' {
}
}
declare module 'vform3-builds' {
const content: any;
export = content;
}
/**
* { a: 1, b: { ba: { baa: 1, bab: 2 }, bb: 2} } ---> a | b.ba.baa | b.ba.bab | b.bb
* https://juejin.cn/post/7280062870670606397
*/
export type ObjKeysToUnion<T, P extends string = ''> = T extends object
? {
[K in keyof T]: ObjKeysToUnion<T[K], P extends '' ? `${K & string}` : `${P}.${K & string}`>;
}[keyof T]
: P;

View File

@ -10,7 +10,7 @@ import FileSaver from 'file-saver';
import { getLanguage } from '@/lang';
import { encryptBase64, encryptWithAes, generateAesKey, decryptWithAes, decryptBase64 } from '@/utils/crypto';
import { encrypt, decrypt } from '@/utils/jsencrypt';
import router from "@/router";
import router from '@/router';
const encryptHeader = 'encrypt-key';
let downloadLoadingInstance: LoadingInstance;
@ -174,18 +174,26 @@ service.interceptors.response.use(
}
);
// 通用下载方法
export function download(url: string, params: any, fileName: string) {
export function download(url: string, params: any, fileName: string, isJson: boolean = false) {
downloadLoadingInstance = ElLoading.service({ text: '正在下载数据,请稍候', background: 'rgba(0, 0, 0, 0.7)' });
// prettier-ignore
return service.post(url, params, {
transformRequest: [
const config = {
headers: {
'Content-Type': isJson ? 'application/json' : 'application/x-www-form-urlencoded'
},
responseType: 'blob' as const,
transformRequest: isJson
? undefined
: [
(params: any) => {
return tansParams(params);
}
],
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob'
}).then(async (resp: any) => {
]
};
// prettier-ignore
return service.post(url, isJson ? params : tansParams(params), config)
.then(async (resp: any) => {
const isLogin = blobValidate(resp);
if (isLogin) {
const blob = new Blob([resp]);

View File

@ -8,11 +8,8 @@ export const initSSE = (url: any) => {
return;
}
url = url + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID
const {
data,
error
} = useEventSource(url, [], {
url = url + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID;
const { data, error } = useEventSource(url, [], {
autoReconnect: {
retries: 10,
delay: 3000,

View File

@ -1,3 +1,15 @@
/**
*
* @param {string} pattern
* @param {string} path
* @returns {Boolean}
*/
export function isPathMatch(pattern: string, path: string) {
const regexPattern = pattern.replace(/\//g, '\\/').replace(/\*\*/g, '.*').replace(/\*/g, '[^\\/]*')
const regex = new RegExp(`^${regexPattern}$`)
return regex.test(path)
}
/**
* url是否是http或https
* @returns {Boolean}

View File

@ -7,7 +7,7 @@ export const initWebSocket = (url: any) => {
if (import.meta.env.VITE_APP_WEBSOCKET === 'false') {
return;
}
url = url + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID
url = url + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID;
useWebSocket(url, {
autoReconnect: {
// 重连最大次数
@ -16,14 +16,14 @@ export const initWebSocket = (url: any) => {
delay: 1000,
onFailed() {
console.log('websocket重连失败');
},
}
},
heartbeat: {
message: JSON.stringify({type: 'ping'}),
message: JSON.stringify({ type: 'ping' }),
// 发送心跳的间隔
interval: 10000,
// 接收到心跳response的超时时间
pongTimeout: 2000,
pongTimeout: 2000
},
onConnected() {
console.log('websocket已经连接');

View File

@ -45,7 +45,7 @@
<el-col :span="1.5">
<el-button v-hasPermi="['demo:demo:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>

View File

@ -25,7 +25,7 @@
<el-col :span="1.5">
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>
<el-table

View File

@ -1,56 +1,73 @@
<template>
<div class="login">
<el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">RuoYi-Vue-Plus多租户管理系统</h3>
<div class="title-box">
<h3 class="title">RuoYi-Vue-Plus多租户管理系统</h3>
<lang-select />
</div>
<el-form-item v-if="tenantEnabled" prop="tenantId">
<el-select v-model="loginForm.tenantId" filterable placeholder="请选择/输入公司名称" style="width: 100%">
<el-select v-model="loginForm.tenantId" filterable :placeholder="$t('login.selectPlaceholder')" style="width: 100%">
<el-option v-for="item in tenantList" :key="item.tenantId" :label="item.companyName" :value="item.tenantId"></el-option>
<template #prefix><svg-icon icon-class="company" class="el-input__icon input-icon" /></template>
</el-select>
</el-form-item>
<el-form-item prop="username">
<el-input v-model="loginForm.username" type="text" size="large" auto-complete="off" placeholder="账号">
<el-input v-model="loginForm.username" type="text" size="large" auto-complete="off" :placeholder="$t('login.username')">
<template #prefix><svg-icon icon-class="user" class="el-input__icon input-icon" /></template>
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input v-model="loginForm.password" type="password" size="large" auto-complete="off" placeholder="密码" @keyup.enter="handleLogin">
<el-input
v-model="loginForm.password"
type="password"
size="large"
auto-complete="off"
:placeholder="$t('login.password')"
@keyup.enter="handleLogin"
>
<template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template>
</el-input>
</el-form-item>
<el-form-item v-if="captchaEnabled" prop="code">
<el-input v-model="loginForm.code" size="large" auto-complete="off" placeholder="验证码" style="width: 63%" @keyup.enter="handleLogin">
<el-input
v-model="loginForm.code"
size="large"
auto-complete="off"
:placeholder="$t('login.code')"
style="width: 63%"
@keyup.enter="handleLogin"
>
<template #prefix><svg-icon icon-class="validCode" class="el-input__icon input-icon" /></template>
</el-input>
<div class="login-code">
<img :src="codeUrl" class="login-code-img" @click="getCode" />
</div>
</el-form-item>
<el-checkbox v-model="loginForm.rememberMe" style="margin: 0 0 25px 0">记住密码</el-checkbox>
<el-checkbox v-model="loginForm.rememberMe" style="margin: 0 0 25px 0">{{ $t('login.rememberPassword') }}</el-checkbox>
<el-form-item style="float: right">
<el-button circle title="微信登录" @click="doSocialLogin('wechat')">
<el-button circle :title="$t('login.social.wechat')" @click="doSocialLogin('wechat')">
<svg-icon icon-class="wechat" />
</el-button>
<el-button circle title="MaxKey登录" @click="doSocialLogin('maxkey')">
<el-button circle :title="$t('login.social.maxkey')" @click="doSocialLogin('maxkey')">
<svg-icon icon-class="maxkey" />
</el-button>
<el-button circle title="TopIam登录" @click="doSocialLogin('topiam')">
<el-button circle :title="$t('login.social.topiam')" @click="doSocialLogin('topiam')">
<svg-icon icon-class="topiam" />
</el-button>
<el-button circle title="Gitee登录" @click="doSocialLogin('gitee')">
<el-button circle :title="$t('login.social.gitee')" @click="doSocialLogin('gitee')">
<svg-icon icon-class="gitee" />
</el-button>
<el-button circle title="Github登录" @click="doSocialLogin('github')">
<el-button circle :title="$t('login.social.github')" @click="doSocialLogin('github')">
<svg-icon icon-class="github" />
</el-button>
</el-form-item>
<el-form-item style="width: 100%">
<el-button :loading="loading" size="large" type="primary" style="width: 100%" @click.prevent="handleLogin">
<span v-if="!loading"> </span>
<span v-else> 中...</span>
<span v-if="!loading">{{ $t('login.login') }}</span>
<span v-else>{{ $t('login.logging') }}</span>
</el-button>
<div v-if="register" style="float: right">
<router-link class="link-type" :to="'/register'">立即注册</router-link>
<router-link class="link-type" :to="'/register'">{{ $t('login.switchRegisterPage') }}</router-link>
</div>
</el-form-item>
</el-form>
@ -68,9 +85,11 @@ import { useUserStore } from '@/store/modules/user';
import { LoginData, TenantVO } from '@/api/types';
import { to } from 'await-to-js';
import { HttpStatus } from '@/enums/RespEnum';
import { useI18n } from 'vue-i18n';
const userStore = useUserStore();
const router = useRouter();
const { t } = useI18n();
const loginForm = ref<LoginData>({
tenantId: '000000',
@ -82,10 +101,10 @@ const loginForm = ref<LoginData>({
} as LoginData);
const loginRules: ElFormRules = {
tenantId: [{ required: true, trigger: 'blur', message: '请输入您的租户编号' }],
username: [{ required: true, trigger: 'blur', message: '请输入您的账号' }],
password: [{ required: true, trigger: 'blur', message: '请输入您的密码' }],
code: [{ required: true, trigger: 'change', message: '请输入验证码' }]
tenantId: [{ required: true, trigger: 'blur', message: t('login.rule.tenantId.required') }],
username: [{ required: true, trigger: 'blur', message: t('login.rule.username.required') }],
password: [{ required: true, trigger: 'blur', message: t('login.rule.password.required') }],
code: [{ required: true, trigger: 'change', message: t('login.rule.code.required') }]
};
const codeUrl = ref('');
@ -105,7 +124,7 @@ const tenantList = ref<TenantVO[]>([]);
watch(
() => router.currentRoute.value,
(newRoute: any) => {
redirect.value = newRoute.query && decodeURIComponent(newRoute.query.redirect);
redirect.value = newRoute.query && newRoute.query.redirect && decodeURIComponent(newRoute.query.redirect);
},
{ immediate: true }
);
@ -176,7 +195,7 @@ const getLoginData = () => {
* 获取租户列表
*/
const initTenantList = async () => {
const { data } = await getTenantList();
const { data } = await getTenantList(false);
tenantEnabled.value = data.tenantEnabled === undefined ? true : data.tenantEnabled;
if (tenantEnabled.value) {
tenantList.value = data.voList;
@ -218,10 +237,19 @@ onMounted(() => {
background-size: cover;
}
.title {
margin: 0px auto 30px auto;
text-align: center;
color: #707070;
.title-box {
display: flex;
.title {
margin: 0px auto 30px auto;
text-align: center;
color: #707070;
}
:deep(.lang-select--style) {
line-height: 0;
color: #7483a3;
}
}
.login-form {

View File

@ -54,7 +54,7 @@
<el-col :span="1.5">
<el-button v-hasPermi="['monitor:logininfor:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>

View File

@ -57,7 +57,7 @@
<el-col :span="1.5">
<el-button v-hasPermi="['monitor:operlog:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>
@ -123,56 +123,14 @@
<pagination v-show="total > 0" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" :total="total" @pagination="getList" />
</el-card>
<!-- 操作日志详细 -->
<el-dialog v-model="dialog.visible" title="操作日志详细" width="700px" append-to-body>
<el-form :model="form" label-width="100px">
<el-row>
<el-col :span="24">
<el-form-item label="登录信息:">{{ form.operName }} / {{ form.deptName }} / {{ form.operIp }} / {{ form.operLocation }}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="请求信息:">{{ form.requestMethod }} {{ form.operUrl }}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="操作模块:">{{ form.title }} / {{ typeFormat(form) }}</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="操作方法:">{{ form.method }}</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="请求参数:">{{ form.operParam }}</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="返回参数:">{{ form.jsonResult }}</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="操作状态:">
<div v-if="form.status === 0">正常</div>
<div v-else-if="form.status === 1">失败</div>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="消耗时间:">{{ form.costTime }}毫秒</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="操作时间:">{{ parseTime(form.operTime) }}</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item v-if="form.status === 1" label="异常信息:">{{ form.errorMsg }}</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialog.visible = false"> </el-button>
</div>
</template>
</el-dialog>
<OperInfoDialog ref="operInfoDialogRef" />
</div>
</template>
<script setup name="Operlog" lang="ts">
import { list, delOperlog, cleanOperlog } from '@/api/monitor/operlog';
import { OperLogForm, OperLogQuery, OperLogVO } from '@/api/monitor/operlog/types';
import OperInfoDialog from './oper-info-dialog.vue';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_oper_type, sys_common_status } = toRefs<any>(proxy?.useDict('sys_oper_type', 'sys_common_status'));
@ -189,11 +147,6 @@ const defaultSort = ref<any>({ prop: 'operTime', order: 'descending' });
const operLogTableRef = ref<ElTableInstance>();
const queryFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
const data = reactive<PageData<OperLogForm, OperLogQuery>>({
form: {
operId: undefined,
@ -267,11 +220,13 @@ const handleSortChange = (column: any) => {
queryParams.value.isAsc = column.order;
getList();
};
const operInfoDialogRef = ref<InstanceType<typeof OperInfoDialog>>();
/** 详细按钮操作 */
const handleView = (row: OperLogVO) => {
dialog.visible = true;
form.value = row;
operInfoDialogRef.value.openDialog(row);
};
/** 删除按钮操作 */
const handleDelete = async (row?: OperLogVO) => {
const operIds = row?.operId || ids.value;

View File

@ -0,0 +1,111 @@
<template>
<el-dialog v-model="open" title="操作日志详细" width="700px" append-to-body close-on-click-modal @closed="info = null">
<el-descriptions v-if="info" :column="1" border>
<el-descriptions-item label="操作状态">
<template #default>
<el-tag v-if="info.status === 0" type="success">正常</el-tag>
<el-tag v-else-if="info.status === 1" type="danger">失败</el-tag>
</template>
</el-descriptions-item>
<el-descriptions-item label="登录信息">
<template #default> {{ info.operName }} / {{ info.deptName }} / {{ info.operIp }} / {{ info.operLocation }} </template>
</el-descriptions-item>
<el-descriptions-item label="请求信息">
<template #default> {{ info.requestMethod }} {{ info.operUrl }} </template>
</el-descriptions-item>
<el-descriptions-item label="操作模块">
<template #default> {{ info.title }} / {{ typeFormat(info) }} </template>
</el-descriptions-item>
<el-descriptions-item label="操作方法">
<template #default>
{{ info.method }}
</template>
</el-descriptions-item>
<el-descriptions-item label="请求参数">
<template #default>
<div class="max-h-300px overflow-y-auto">
<VueJsonPretty :data="formatToJsonObject(info.operParam)" />
</div>
</template>
</el-descriptions-item>
<el-descriptions-item label="返回参数">
<template #default>
<div class="max-h-300px overflow-y-auto">
<VueJsonPretty :data="formatToJsonObject(info.jsonResult)" />
</div>
</template>
</el-descriptions-item>
<el-descriptions-item label="消耗时间">
<template #default>
<span> {{ info.costTime }}ms </span>
</template>
</el-descriptions-item>
<el-descriptions-item label="操作时间">
<template #default> {{ parseTime(info.operTime) }}</template>
</el-descriptions-item>
<el-descriptions-item v-if="info.status === 1" label="异常信息">
<template #default>
<span class="text-danger"> {{ info.errorMsg }}</span>
</template>
</el-descriptions-item>
</el-descriptions>
</el-dialog>
</template>
<script setup lang="ts">
import type { OperLogForm } from '@/api/monitor/operlog/types';
import VueJsonPretty from 'vue-json-pretty';
import 'vue-json-pretty/lib/styles.css';
const open = ref(false);
const info = ref<OperLogForm | null>(null);
function openDialog(row: OperLogForm) {
info.value = row;
open.value = true;
}
function closeDialog() {
open.value = false;
}
defineExpose({
openDialog,
closeDialog
});
/**
* json转为对象
* @param data 原始数据
*/
function formatToJsonObject(data: string) {
try {
return JSON.parse(data);
} catch (error) {
return data;
}
}
/**
* 字典信息
*/
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_oper_type } = toRefs<any>(proxy?.useDict('sys_oper_type'));
const typeFormat = (row: OperLogForm) => {
return proxy?.selectDictLabel(sys_oper_type.value, row.businessType);
};
</script>
<style scoped>
/**
label宽度固定
*/
:deep(.el-descriptions__label) {
min-width: 100px;
}
/**
文字超过 换行显示
*/
:deep(.el-descriptions__content) {
max-width: 300px;
}
</style>

View File

@ -1,20 +1,30 @@
<template>
<div class="register">
<el-form ref="registerRef" :model="registerForm" :rules="registerRules" class="register-form">
<h3 class="title">RuoYi-Vue-Plus多租户管理系统</h3>
<div class="title-box">
<h3 class="title">RuoYi-Vue-Plus多租户管理系统</h3>
<lang-select />
</div>
<el-form-item v-if="tenantEnabled" prop="tenantId">
<el-select v-model="registerForm.tenantId" filterable placeholder="请选择/输入公司名称" style="width: 100%">
<el-select v-model="registerForm.tenantId" filterable :placeholder="$t('register.selectPlaceholder')" style="width: 100%">
<el-option v-for="item in tenantList" :key="item.tenantId" :label="item.companyName" :value="item.tenantId"> </el-option>
<template #prefix><svg-icon icon-class="company" class="el-input__icon input-icon" /></template>
</el-select>
</el-form-item>
<el-form-item prop="username">
<el-input v-model="registerForm.username" type="text" size="large" auto-complete="off" placeholder="账号">
<el-input v-model="registerForm.username" type="text" size="large" auto-complete="off" :placeholder="$t('register.username')">
<template #prefix><svg-icon icon-class="user" class="el-input__icon input-icon" /></template>
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input v-model="registerForm.password" type="password" size="large" auto-complete="off" placeholder="密码" @keyup.enter="handleRegister">
<el-input
v-model="registerForm.password"
type="password"
size="large"
auto-complete="off"
:placeholder="$t('register.password')"
@keyup.enter="handleRegister"
>
<template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template>
</el-input>
</el-form-item>
@ -24,14 +34,21 @@
type="password"
size="large"
auto-complete="off"
placeholder="确认密码"
:placeholder="$t('register.confirmPassword')"
@keyup.enter="handleRegister"
>
<template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template>
</el-input>
</el-form-item>
<el-form-item v-if="captchaEnabled" prop="code">
<el-input v-model="registerForm.code" size="large" auto-complete="off" placeholder="验证码" style="width: 63%" @keyup.enter="handleRegister">
<el-input
v-model="registerForm.code"
size="large"
auto-complete="off"
:placeholder="$t('register.code')"
style="width: 63%"
@keyup.enter="handleRegister"
>
<template #prefix><svg-icon icon-class="validCode" class="el-input__icon input-icon" /></template>
</el-input>
<div class="register-code">
@ -40,11 +57,11 @@
</el-form-item>
<el-form-item style="width: 100%">
<el-button :loading="loading" size="large" type="primary" style="width: 100%" @click.prevent="handleRegister">
<span v-if="!loading"> </span>
<span v-else> 中...</span>
<span v-if="!loading">{{ $t('register.register') }}</span>
<span v-else>{{ $t('register.registering') }}</span>
</el-button>
<div style="float: right">
<router-link class="link-type" :to="'/login'">使用已有账户登录</router-link>
<router-link class="link-type" :to="'/login'">{{ $t('register.switchLoginPage') }}</router-link>
</div>
</el-form-item>
</el-form>
@ -59,9 +76,12 @@
import { getCodeImg, register, getTenantList } from '@/api/login';
import { RegisterForm, TenantVO } from '@/api/types';
import { to } from 'await-to-js';
import { useI18n } from 'vue-i18n';
const router = useRouter();
const { t } = useI18n();
const registerForm = ref<RegisterForm>({
tenantId: '',
username: '',
@ -77,28 +97,28 @@ const tenantEnabled = ref(true);
const equalToPassword = (rule: any, value: string, callback: any) => {
if (registerForm.value.password !== value) {
callback(new Error('两次输入的密码不一致'));
callback(new Error(t('register.rule.confirmPassword.equalToPassword')));
} else {
callback();
}
};
const registerRules: ElFormRules = {
tenantId: [{ required: true, trigger: 'blur', message: '请输入您的租户编号' }],
tenantId: [{ required: true, trigger: 'blur', message: t('register.rule.tenantId.required') }],
username: [
{ required: true, trigger: 'blur', message: '请输入您的账号' },
{ min: 2, max: 20, message: '用户账号长度必须介于 2 和 20 之间', trigger: 'blur' }
{ required: true, trigger: 'blur', message: t('register.rule.username.required') },
{ min: 2, max: 20, message: t('register.rule.username.length', { min: 2, max: 20 }), trigger: 'blur' }
],
password: [
{ required: true, trigger: 'blur', message: '请输入您的密码' },
{ min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' },
{ pattern: /^[^<>"'|\\]+$/, message: '不能包含非法字符:< > " \' \\\ |', trigger: 'blur' }
{ required: true, trigger: 'blur', message: t('register.rule.password.required') },
{ min: 5, max: 20, message: t('register.rule.password.length', { min: 5, max: 20 }), trigger: 'blur' },
{ pattern: /^[^<>"'|\\]+$/, message: t('register.rule.password.pattern', { strings: '< > " \' \\ |' }), trigger: 'blur' }
],
confirmPassword: [
{ required: true, trigger: 'blur', message: '请再次输入您的密码' },
{ required: true, trigger: 'blur', message: t('register.rule.confirmPassword.required') },
{ required: true, validator: equalToPassword, trigger: 'blur' }
],
code: [{ required: true, trigger: 'change', message: '请输入验证码' }]
code: [{ required: true, trigger: 'change', message: t('register.rule.code.required') }]
};
const codeUrl = ref('');
const loading = ref(false);
@ -114,7 +134,8 @@ const handleRegister = () => {
const [err] = await to(register(registerForm.value));
if (!err) {
const username = registerForm.value.username;
await ElMessageBox.alert("<font color='red'>恭喜你,您的账号 " + username + ' 注册成功!</font>', '系统提示', {
await ElMessageBox.alert('<span style="color: red; ">' + t('register.registerSuccess', { username }) + '</font>', '系统提示', {
app: undefined,
dangerouslyUseHTMLString: true,
type: 'success'
});
@ -140,7 +161,7 @@ const getCode = async () => {
};
const initTenantList = async () => {
const { data } = await getTenantList();
const { data } = await getTenantList(false);
tenantEnabled.value = data.tenantEnabled === undefined ? true : data.tenantEnabled;
if (tenantEnabled.value) {
tenantList.value = data.voList;
@ -166,10 +187,20 @@ onMounted(() => {
background-size: cover;
}
.title {
margin: 0 auto 30px auto;
text-align: center;
color: #707070;
.title-box {
display: flex;
.title {
margin: 0px auto 30px auto;
text-align: center;
color: #707070;
}
:deep(.lang-select--style) {
line-height: 0;
color: #7483a3;
}
}
.register-form {

View File

@ -41,7 +41,7 @@
<el-col :span="1.5">
<el-button v-hasPermi="['system:client:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>

View File

@ -56,7 +56,7 @@
<el-col :span="1.5">
<el-button v-hasPermi="['system:config:remove']" type="danger" plain icon="Refresh" @click="handleRefreshCache">刷新缓存</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>
@ -101,7 +101,7 @@
<el-input v-model="form.configKey" placeholder="请输入参数键名" />
</el-form-item>
<el-form-item label="参数键值" prop="configValue">
<el-input v-model="form.configValue" placeholder="请输入参数键值" />
<el-input v-model="form.configValue" type="textarea" placeholder="请输入参数键值" />
</el-form-item>
<el-form-item label="系统内置" prop="configType">
<el-radio-group v-model="form.configType">

View File

@ -33,7 +33,7 @@
<el-col :span="1.5">
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>

View File

@ -40,7 +40,7 @@
<el-col :span="1.5">
<el-button type="warning" plain icon="Close" @click="handleClose">关闭</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>

View File

@ -49,10 +49,7 @@
<el-col :span="1.5">
<el-button v-hasPermi="['system:dict:remove']" type="danger" plain icon="Refresh" @click="handleRefreshCache">刷新缓存</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-if="userId === 1" type="success" plain icon="Refresh" @click="handleSyncTenantDict">同步租户字典</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>
@ -112,15 +109,11 @@
<script setup name="Dict" lang="ts">
import useDictStore from '@/store/modules/dict';
import useUserStore from "@/store/modules/user";
import { listType, getType, delType, addType, updateType, refreshCache } from '@/api/system/dict/type';
import { DictTypeForm, DictTypeQuery, DictTypeVO } from '@/api/system/dict/type/types';
import { syncTenantDict } from "@/api/system/tenant";
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const userStore = useUserStore();
const userId = ref(userStore.userId);
const typeList = ref<DictTypeVO[]>([]);
const loading = ref(true);
const showSearch = ref(true);
@ -246,12 +239,6 @@ const handleRefreshCache = async () => {
proxy?.$modal.msgSuccess('刷新成功');
useDictStore().cleanDict();
};
/**同步租户字典*/
const handleSyncTenantDict = async () => {
await proxy?.$modal.confirm('确认要同步所有租户字典吗?');
let res = await syncTenantDict();
proxy?.$modal.msgSuccess(res.msg);
};
onMounted(() => {
getList();

View File

@ -30,7 +30,7 @@
<el-col :span="1.5">
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>

View File

@ -40,7 +40,7 @@
删除
</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>

View File

@ -41,7 +41,7 @@
删除
</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>

View File

@ -62,7 +62,7 @@
<el-col :span="1.5">
<el-button v-hasPermi="['system:ossConfig:list']" type="info" plain icon="Operation" @click="handleOssConfig">配置管理</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>

View File

@ -81,7 +81,7 @@
<el-col :span="1.5">
<el-button v-hasPermi="['system:post:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">

View File

@ -30,7 +30,7 @@
<el-col :span="1.5">
<el-button type="warning" plain icon="Close" @click="handleClose">关闭</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" :search="true" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" :search="true" @query-table="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">

View File

@ -51,7 +51,7 @@
<el-col :span="1.5">
<el-button v-hasPermi="['system:role:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>
@ -223,7 +223,8 @@ const dataScopeOptions = ref([
{ value: '2', label: '自定数据权限' },
{ value: '3', label: '本部门数据权限' },
{ value: '4', label: '本部门及以下数据权限' },
{ value: '5', label: '仅本人数据权限' }
{ value: '5', label: '仅本人数据权限' },
{ value: '6', label: '部门及以下或本人数据权限' }
]);
const queryFormRef = ref<ElFormInstance>();

View File

@ -44,7 +44,10 @@
<el-col :span="1.5">
<el-button v-hasPermi="['system:tenant:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<el-col :span="1.5">
<el-button v-if="userId === 1" type="success" plain icon="Refresh" @click="handleSyncTenantDict">同步租户字典</el-button>
</el-col>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>
@ -141,13 +144,25 @@
</template>
<script setup name="Tenant" lang="ts">
import { listTenant, getTenant, delTenant, addTenant, updateTenant, changeTenantStatus, syncTenantPackage } from '@/api/system/tenant';
import {
listTenant,
getTenant,
delTenant,
addTenant,
updateTenant,
changeTenantStatus,
syncTenantPackage,
syncTenantDict
} from '@/api/system/tenant';
import { selectTenantPackage } from '@/api/system/tenantPackage';
import useUserStore from '@/store/modules/user';
import { TenantForm, TenantQuery, TenantVO } from '@/api/system/tenant/types';
import { TenantPkgVO } from '@/api/system/tenantPackage/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const userStore = useUserStore();
const userId = ref(userStore.userId);
const tenantList = ref<TenantVO[]>([]);
const packageList = ref<TenantPkgVO[]>([]);
const buttonLoading = ref(false);
@ -343,6 +358,13 @@ const handleExport = () => {
);
};
/**同步租户字典*/
const handleSyncTenantDict = async () => {
await proxy?.$modal.confirm('确认要同步所有租户字典吗?');
let res = await syncTenantDict();
proxy?.$modal.msgSuccess(res.msg);
};
onMounted(() => {
getList();
});

View File

@ -35,7 +35,7 @@
<el-col :span="1.5">
<el-button v-hasPermi="['system:tenantPackage:export']" type="warning" plain icon="Download" @click="handleExport">导出 </el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>

View File

@ -80,7 +80,7 @@ const tableRef = ref<ElTableInstance>();
/** 单击选中行数据 */
const clickRow = (row: RoleVO) => {
row.flag = !row.flag
row.flag = !row.flag;
tableRef.value?.toggleRowSelection(row, row.flag);
};
/** 多选框选中数据 */

View File

@ -81,13 +81,13 @@
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item icon="Download" @click="importTemplate">下载模板</el-dropdown-item>
<el-dropdown-item icon="Top" @click="handleImport"> 导入数据</el-dropdown-item>
<el-dropdown-item icon="Top" @click="handleImport">导入数据</el-dropdown-item>
<el-dropdown-item icon="Download" @click="handleExport"> 导出数据</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</el-col>
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" :columns="columns" :search="true" @query-table="getList"></right-toolbar>
</el-row>
</template>
@ -393,7 +393,7 @@ const initData: PageData<UserForm, UserQuery> = {
message: '用户密码长度必须介于 5 和 20 之间',
trigger: 'blur'
},
{ pattern: /^[^<>"'|\\]+$/, message: '不能包含非法字符:< > " \' \\\ |', trigger: 'blur' }
{ pattern: /^[^<>"'|\\]+$/, message: '不能包含非法字符:< > " \' \\ |', trigger: 'blur' }
],
email: [
{
@ -506,7 +506,7 @@ const handleResetPwd = async (row: UserVO) => {
inputErrorMessage: '用户密码长度必须介于 5 和 20 之间',
inputValidator: (value) => {
if (/<|>|"|'|\||\\/.test(value)) {
return '不能包含非法字符:< > " \' \\\ |';
return '不能包含非法字符:< > " \' \\ |';
}
}
})

View File

@ -45,7 +45,7 @@ const rules = ref({
message: '长度在 6 到 20 个字符',
trigger: 'blur'
},
{ pattern: /^[^<>"'|\\]+$/, message: '不能包含非法字符:< > " \' \\\ |', trigger: 'blur' }
{ pattern: /^[^<>"'|\\]+$/, message: '不能包含非法字符:< > " \' \\ |', trigger: 'blur' }
],
confirmPassword: [
{ required: true, message: '确认密码不能为空', trigger: 'blur' },

View File

@ -63,14 +63,18 @@ const emit = defineEmits(['ok']);
/** 查询参数列表 */
const show = (dataName: string) => {
getDataNameList();
if (dataName) {
queryParams.dataName = dataName;
} else {
queryParams.dataName = 'master';
}
getList();
visible.value = true;
getDataNames().then((res) => {
if (res.code == 200) {
dataNameList.value = res.data;
if (dataName) {
queryParams.dataName = dataName;
} else {
queryParams.dataName = dataNameList.value[0];
}
getList();
visible.value = true;
}
});
};
/** 单击选择行 */
const clickRow = (row: DbTableVO) => {
@ -111,11 +115,6 @@ const handleImportTable = async () => {
emit('ok');
}
};
/** 查询多数据源名称 */
const getDataNameList = async () => {
const res = await getDataNames();
dataNameList.value = res.data;
};
defineExpose({
show

View File

@ -52,7 +52,7 @@
删除
</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>
@ -113,8 +113,8 @@
</template>
<script setup name="Gen" lang="ts">
import { listTable, previewTable, delTable, genCode, synchDb, getDataNames } from '@/api/tool/gen';
import { TableQuery, TableVO } from '@/api/tool/gen/types';
import {delTable, genCode, getDataNames, listTable, previewTable, synchDb} from '@/api/tool/gen';
import {TableQuery, TableVO} from '@/api/tool/gen/types';
import router from '@/router';
import ImportTable from './importTable.vue';
@ -155,17 +155,6 @@ const dialog = reactive<DialogOption>({
title: '代码预览'
});
onActivated(() => {
const time = route.query.t;
if (time != null && time != uniqueId.value) {
uniqueId.value = time as string;
queryParams.value.pageNum = Number(route.query.pageNum);
dateRange.value = ['', ''];
queryFormRef.value?.resetFields();
getList();
}
});
/** 查询多数据源名称 */
const getDataNameList = async () => {
const res = await getDataNames();
@ -248,7 +237,14 @@ const handleDelete = async (row?: TableVO) => {
};
onMounted(() => {
getList();
const time = route.query.t;
if (time != null && time != uniqueId.value) {
uniqueId.value = time as string;
queryParams.value.pageNum = Number(route.query.pageNum);
dateRange.value = ['', ''];
queryFormRef.value?.resetFields();
getList();
}
getDataNameList();
});
</script>

View File

@ -26,7 +26,7 @@
<el-col :span="1.5">
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>
<el-table

View File

@ -33,7 +33,7 @@
<el-col :span="1.5">
<el-button v-hasPermi="['workflow:formManage:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>

View File

@ -27,7 +27,7 @@
<el-col :span="1.5">
<el-button v-hasPermi="['workflow:leave:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>

View File

@ -192,8 +192,8 @@ const handleStartWorkFlow = async (data: LeaveVO) => {
taskVariables.value = {
entity: data,
leaveDays: data.leaveDays,
userList: ["1", "3"],
userList2: ["1", "3"]
userList: ['1', '3'],
userList2: ['1', '3']
};
submitFormData.value.variables = taskVariables.value;
const resp = await startWorkFlow(submitFormData.value);

View File

@ -53,7 +53,7 @@
<el-col :span="1.5">
<el-button type="primary" plain :disabled="multiple" icon="Download" @click="clickExportZip()">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>

View File

@ -47,7 +47,7 @@
<el-col :span="1.5">
<el-button type="primary" icon="UploadFilled" @click="uploadDialog.visible = true">部署流程文件</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>
</template>

View File

@ -52,7 +52,7 @@
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete">删除</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="handleQuery"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="handleQuery"></right-toolbar>
</el-row>
</template>

View File

@ -35,7 +35,7 @@
<el-col :span="1.5">
<el-button type="primary" plain icon="Edit" :disabled="multiple" @click="handleUpdate">修改办理人</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @query-table="handleQuery"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="handleQuery"></right-toolbar>
</el-row>
</template>

View File

@ -38,7 +38,7 @@
<el-card shadow="hover">
<template #header>
<el-row :gutter="10" class="mb8">
<right-toolbar v-model:showSearch="showSearch" @query-table="handleQuery"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="handleQuery"></right-toolbar>
</el-row>
</template>

View File

@ -24,7 +24,7 @@
<el-card shadow="hover">
<template #header>
<el-row :gutter="10" class="mb8">
<right-toolbar v-model:showSearch="showSearch" @query-table="handleQuery"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="handleQuery"></right-toolbar>
</el-row>
</template>

View File

@ -24,7 +24,7 @@
<el-card shadow="hover">
<template #header>
<el-row :gutter="10" class="mb8">
<right-toolbar v-model:showSearch="showSearch" @query-table="handleQuery"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="handleQuery"></right-toolbar>
</el-row>
</template>

View File

@ -24,7 +24,7 @@
<el-card shadow="hover">
<template #header>
<el-row :gutter="10" class="mb8">
<right-toolbar v-model:showSearch="showSearch" @query-table="handleQuery"></right-toolbar>
<right-toolbar v-model:show-search="showSearch" @query-table="handleQuery"></right-toolbar>
</el-row>
</template>

View File

@ -2,7 +2,7 @@
"compilerOptions": {
"target": "esnext",
"module": "esnext",
// "useDefineForClassFields": true,
// "useDefineForClassFields": true,
"moduleResolution": "bundler",
"strict": true,
"jsx": "preserve",

View File

@ -1,6 +0,0 @@
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
export default (path: any) => {
return VueI18nPlugin({
include: [path.resolve(__dirname, '../../src/lang/**.json')]
});
};

View File

@ -6,7 +6,6 @@ import createIcons from './icons';
import createSvgIconsPlugin from './svg-icon';
import createCompression from './compression';
import createSetupExtend from './setup-extend';
import createI18n from './i18n';
import path from 'path';
export default (viteEnv: any, isBuild = false): [] => {
@ -19,6 +18,5 @@ export default (viteEnv: any, isBuild = false): [] => {
vitePlugins.push(createIcons());
vitePlugins.push(createSvgIconsPlugin(path, isBuild));
vitePlugins.push(createSetupExtend());
vitePlugins.push(createI18n(path));
return vitePlugins;
};