18 Commits
v2.3.0 ... dev

Author SHA1 Message Date
9eab97b1c0 docs: 更新 README 文档 2024-04-28 22:12:02 +08:00
3d528795ff docs: 更新 README 文档 2024-04-24 22:45:23 +08:00
aa3eaebf6a release: v2.5.0 2024-03-23 22:05:07 +08:00
Bull-BCLS
2353caffa9 feat(generator): 新增代码批量生成功能 2024-03-23 21:19:09 +08:00
7792cd398f refactor(generator): 重构代码生成功能,由指定路径生成模式调整为下载模式,更方便复杂场景 2024-03-15 00:01:33 +08:00
e6fa9f60a9 refactor: 优化部分 ref API 使用方式 2024-03-11 22:17:36 +08:00
e9d3865892 chore: 代码生成字段配置增加字段排序信息 2024-03-07 23:04:27 +08:00
aeafc2ece2 style: 调整文件管理配置存储库按钮风格 2024-03-06 22:59:58 +08:00
6f5c35ea77 chore: 适配部分 API 响应格式调整为 kv 格式的变化 2024-03-06 22:53:06 +08:00
b4bb4693df chore: 调整代码生成 API 地址 2024-03-05 22:54:56 +08:00
3d32736368 chore: 更新版本号为 2.5.0-SNAPSHOT 2024-03-05 22:08:22 +08:00
55aec6a720 release: v2.4.0 2024-02-16 18:28:46 +08:00
dd1127e2b8 fix: 修复项目打包报错,类型错误 2024-02-14 22:46:14 +08:00
678aa92457 refactor: 部分 ID 列 => 序号列 2024-02-13 22:09:36 +08:00
65e564dc67 fix: 修复暗黑模式下返回到登录页面时的部分样式错乱
仅修复了部分

Closes #3
2024-02-05 00:09:23 +08:00
e519d746c9 refactor: 取消用户默认密码,改为表单填写密码 2024-02-02 23:44:42 +08:00
735982373a feat: 系统日志详情新增 traceId 链路号显示 2024-01-31 21:52:25 +08:00
9fa765ce50 chore: 更新版本号 2024-01-22 20:28:34 +08:00
33 changed files with 493 additions and 274 deletions

View File

@@ -1,56 +0,0 @@
name: Deploy
on:
# 推送时执行
push:
branches: [dev]
# 可手动执行
workflow_dispatch:
jobs:
deploy-web:
runs-on: ubuntu-latest
steps:
# 1、检出源码
- name: Checkout
uses: actions/checkout@master
# 2、安装 PNPM
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: latest
# 3、安装 Node 环境
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: pnpm
cache-dependency-path: ./pnpm-lock.yaml
# 4、安装依赖
- name: Install Dependencies
run: pnpm i --frozen-lockfile
# 5、打包
- name: Build
run: pnpm build
# 6、拷贝到服务器
- name: Copy
uses: garygrossgarten/github-action-scp@release
with:
host: ${{ secrets.SERVER_HOST }}
port: ${{ secrets.SERVER_PORT }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
local: ./dist
remote: /docker/continew-admin/tmp
# 7、重启 Nginx
- name: Restart
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
port: ${{ secrets.SERVER_PORT }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
script: |
rm -rf /docker/continew-admin/html/*
mv /docker/continew-admin/tmp/* /docker/continew-admin/html
docker restart nginx

View File

@@ -1,16 +1,46 @@
## v2.5.0 (2024-03-23)
### ✨ 新特性
* 新增代码批量生成功能 ([2353caf](https://github.com/Charles7c/continew-admin-ui-arco/commit/2353caffa9ddfbf8c0f9657c1f2e89b14eff38db))
### 💎 功能优化
- 调整代码生成 API 地址 ([b4bb469](https://github.com/Charles7c/continew-admin-ui-arco/commit/b4bb4693dfd694bcc5f10be32cf7d405af92367e))
- 适配部分 API 响应格式调整为 kv 格式的变化 ([6f5c35e](https://github.com/Charles7c/continew-admin-ui-arco/commit/6f5c35ea77b1e3880bca477ec027d074915341e8))
- 调整文件管理配置存储库按钮风格 ([aeafc2e](https://github.com/Charles7c/continew-admin-ui-arco/commit/aeafc2ece2012b53bfe8ff6c64fed9ad73f9d188))
- 代码生成字段配置增加字段排序信息 ([e9d3865](https://github.com/Charles7c/continew-admin-ui-arco/commit/e9d38658920f49e0bb0600e779621c44d388057e))
- 优化部分 ref API 使用方式 ([e6fa9f6](https://github.com/Charles7c/continew-admin-ui-arco/commit/e6fa9f60a927f639b8b7f6145982a395506b3150))
- 重构代码生成功能,由指定路径生成模式调整为下载模式,更方便复杂场景 ([7792cd3](https://github.com/Charles7c/continew-admin-ui-arco/commit/7792cd398f6c4a2d10187cb548ba687dc8f62c84))
## v2.4.0 (2024-02-16)
### ✨ 新特性
* 系统日志详情新增 traceId 链路号显示 ([7359823](https://github.com/Charles7c/continew-admin-ui-arco/commit/735982373a13889340970623bce544dafc574cdb))
### 💎 功能优化
- 取消用户默认密码,改为表单填写密码 ([e519d74](https://github.com/Charles7c/continew-admin-ui-arco/commit/e519d746c92596d0b4a568aef26218b8c4c1e4f4)) ([dd1127e](https://github.com/Charles7c/continew-admin-ui-arco/commit/dd1127e2b8ddfad70e67fca5502505fb269236cc))
- 部分 ID 列 => 序号列 ([678aa92](https://github.com/Charles7c/continew-admin-ui-arco/commit/678aa92457dc172a300e78e9523ab0fe50715947))
### 🐛 问题修复
- 修复暗黑模式下返回到登录页面时的部分样式错乱 ([65e564d](https://github.com/Charles7c/continew-admin-ui-arco/commit/65e564dc67c06a18bc543d032d430718ae620cb9))
## v2.3.0 (2024-01-21)
### ✨ 新特性
* 引入 unplugin-auto-import减少重复性 Vue 函数引入 ([b56f029](https://github.com/Charles7c/continew-admin-ui/commit/b56f029e680dc86f8bba174d80ef90ed11f9f25c))
* 引入 unplugin-auto-import减少重复性 Vue 函数引入 ([b56f029](https://github.com/Charles7c/continew-admin-ui-arco/commit/b56f029e680dc86f8bba174d80ef90ed11f9f25c))
### 💎 功能优化
- 优化部分弹窗提示 ([74b03bc](https://github.com/Charles7c/continew-admin-ui/commit/74b03bc3f62e90e987ff9b1a72fedaa903f85b1e))
- 优化部分字段名称 ([b2aa711](https://github.com/Charles7c/continew-admin-ui/commit/b2aa7114bca66c7c9ab9e71a7f757390cf2a4e54))
- ESLint 配置语义化 ([cd34761](https://github.com/Charles7c/continew-admin-ui/commit/cd3476107ef69f0889473abee416db3ad29701e7))
- 调整 Vue 组件内 script 标签到 template 标签之前 ([01dd38f](https://github.com/Charles7c/continew-admin-ui/commit/01dd38f8abccf5d88d8cd0d73df438f3389de7f7))
- 优化部分弹窗提示 ([74b03bc](https://github.com/Charles7c/continew-admin-ui-arco/commit/74b03bc3f62e90e987ff9b1a72fedaa903f85b1e))
- 优化部分字段名称 ([b2aa711](https://github.com/Charles7c/continew-admin-ui-arco/commit/b2aa7114bca66c7c9ab9e71a7f757390cf2a4e54))
- ESLint 配置语义化 ([cd34761](https://github.com/Charles7c/continew-admin-ui-arco/commit/cd3476107ef69f0889473abee416db3ad29701e7))
- 调整 Vue 组件内 script 标签到 template 标签之前 ([01dd38f](https://github.com/Charles7c/continew-admin-ui-arco/commit/01dd38f8abccf5d88d8cd0d73df438f3389de7f7))
### 🐛 问题修复
- 修复 fieldset 在暗黑模式的样式问题 ([470fad3](https://github.com/Charles7c/continew-admin-ui/commit/470fad3a0bfd3fbd343252a49078b28b779d1be5))
- 修复 fieldset 在暗黑模式的样式问题 ([470fad3](https://github.com/Charles7c/continew-admin-ui-arco/commit/470fad3a0bfd3fbd343252a49078b28b779d1be5))

View File

@@ -1,10 +1,22 @@
# ContiNew Admin UI
<a href="https://github.com/Charles7c/continew-admin-ui/blob/dev/LICENSE" target="_blank">
<a href="https://github.com/Charles7c/continew-admin-ui-arco/blob/dev/LICENSE" target="_blank">
<img src="https://img.shields.io/badge/License-Apache--2.0-blue.svg" alt="License" />
</a>
<a href="https://github.com/Charles7c/continew-admin-ui" target="_blank">
<img src="https://img.shields.io/badge/RELEASE-v2.3.0-%23ff3f59.svg" alt="Release" />
<a href="https://github.com/Charles7c/continew-admin-ui-arco" target="_blank">
<img src="https://img.shields.io/badge/RELEASE-v2.5.0-%23ff3f59.svg" alt="Release" />
</a>
<a href="https://cn.vuejs.org/" target="_blank">
<img src="https://img.shields.io/badge/Vue-3.3.7-%236CB52D.svg?logo=Vue.js" alt="Release" />
</a>
<a href="https://arco.design/vue/docs/start" target="_blank">
<img src="https://img.shields.io/badge/Arco Design-2.53.3-%236CB52D.svg" alt="Release" />
</a>
<a href="https://ts.nodejs.cn/" target="_blank">
<img src="https://img.shields.io/badge/TypeScript-5.3.3-%236CB52D.svg?logo=TypeScript&logoColor=FFF" alt="Release" />
</a>
<a href="https://cn.vitejs.dev/" target="_blank">
<img src="https://img.shields.io/badge/Vite-4.5.1-%236CB52D.svg?logo=Vite&logoColor=FFF" alt="Release" />
</a>
<a href="https://github.com/Charles7c/continew-admin" target="_blank">
<img src="https://img.shields.io/github/stars/Charles7c/continew-admin?style=social" alt="GitHub stars" />
@@ -18,21 +30,11 @@
<a href="https://gitee.com/Charles7c/continew-admin" target="_blank">
<img src="https://gitee.com/Charles7c/continew-admin/badge/fork.svg?theme=white" alt="Gitee forks" />
</a>
<a href="https://github.com/Charles7c/continew-admin-ui" target="_blank">
<img src="https://img.shields.io/badge/Vue-3.3.7-%236CB52D.svg" alt="Release" />
</a>
<a href="https://github.com/Charles7c/continew-admin-ui" target="_blank">
<img src="https://img.shields.io/badge/Arco Design Vue-2.53.3-%236CB52D.svg" alt="Release" />
</a>
<a href="https://github.com/Charles7c/continew-admin-ui" target="_blank">
<img src="https://img.shields.io/badge/TypeScript-5.3.3-%236CB52D.svg" alt="Release" />
</a>
<a href="https://github.com/Charles7c/continew-admin-ui" target="_blank">
<img src="https://img.shields.io/badge/Vite-4.5.1-%236CB52D.svg" alt="Release" />
</a>
📚 [在线文档](https://doc.charles7c.top) | 🚀 [演示地址](https://cnadmin.charles7c.top)(账号/密码admin/admin123
> 全新 3.0 已经发布,点击[前往](https://gitee.com/continew/continew-admin-ui)
## 简介
ContiNew AdminContinue New Admin持续迭代优化的前后端分离中后台管理系统框架。开箱即用持续提供舒适的开发体验依托开源协作模式提升技术透明度、放大集体智慧、共创优秀实践源源不断地为企业级项目开发提供助力。
@@ -59,10 +61,11 @@ ContiNew AdminContinue New Admin持续迭代优化的前后端分离中后
## 项目源码
| | 前端源码 | 后端源码 |
| ----- | -------------------------------------------- | ----------------------------------------- |
| GitHub | [github.com/Charles7c/continew-admin-ui](https://github.com/Charles7c/continew-admin-ui) | [github.com/Charles7c/continew-admin](https://github.com/Charles7c/continew-admin) |
| Gitee | [gitee.com/Charles7c/continew-admin-ui](https://gitee.com/Charles7c/continew-admin-ui) | [gitee.com/Charles7c/continew-admin](https://gitee.com/Charles7c/continew-admin) |
| | Gitee | GitHub |
|------------|-------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| 前端 | [gitee.com/continew/continew-admin-ui-arco](https://gitee.com/continew/continew-admin-ui-arco) | [github.com/Charles7c/continew-admin-ui-arco](https://github.com/Charles7c/continew-admin-ui-arco-arco) |
| 后端 | [gitee.com/continew/continew-admin](https://gitee.com/continew/continew-admin) | [github.com/Charles7c/continew-admin](https://github.com/Charles7c/continew-admin) |
| **3.0 前端** | [gitee.com/continew/continew-admin-ui](https://gitee.com/continew/continew-admin-ui) | [github.com/Charles7c/continew-admin-ui](https://github.com/Charles7c/continew-admin-ui-arco) |
## 系统功能
@@ -281,7 +284,7 @@ ContiNew Admin 的分支目前分为下个大版本的开发分支和上个大
2. 然后,将 fork 过来的项目(即您的项目)克隆到本地
3. 切换到当前仍在维护的分支(请务必充分了解分支使用说明,可进群联系维护者确认)
4. 开始修改代码,修改完成后,将代码 commit 并 push 到您的远程仓库
5. 在 Gitee 或 Github 上新建 pull requestpr选择好源和目标按模板要求填写说明信息后提交即可多多参考 [已批准合并的 pr 记录](https://github.com/Charles7c/continew-admin-ui/pulls?q=is%3Apr+is%3Amerged),会大大增加批准合并率)
5. 在 Gitee 或 Github 上新建 pull requestpr选择好源和目标按模板要求填写说明信息后提交即可多多参考 [已批准合并的 pr 记录](https://github.com/Charles7c/continew-admin-ui-arco/pulls?q=is%3Apr+is%3Amerged),会大大增加批准合并率)
6. 最后,耐心等待维护者合并您的请求即可
请记住,如果您有任何疑问或需要帮助,我们将随时提供支持。
@@ -308,7 +311,7 @@ ContiNew Admin 的分支目前分为下个大版本的开发分支和上个大
</div>
<details>
<summary>无加群意愿</summary>
如无加群意愿,欢迎在 <a href="https://github.com/Charles7c/continew-admin-ui/issues" target="_blank">Issues</a> 中反馈交流~ 🍻
如无加群意愿,欢迎在 <a href="https://github.com/Charles7c/continew-admin-ui-arco/issues" target="_blank">Issues</a> 中反馈交流~ 🍻
</details>
## 鸣谢
@@ -323,7 +326,7 @@ ContiNew Admin 的分支目前分为下个大版本的开发分支和上个大
### 特别鸣谢
- 感谢 <a href="https://www.jetbrains.com/" target="_blank">JetBrains</a> 提供的 <a href="https://www.jetbrains.com/shop/eform/opensource" target="_blank">非商业开源软件开发授权</a>
- 感谢 <a href="https://www.jetbrains.com/" target="_blank">JetBrains</a> 提供的 <a href="https://jb.gg/OpenSourceSupport" target="_blank">非商业开源软件开发授权</a>
- 感谢 <a href="http://pro.arco.design/" target="_blank">Arco Design Pro</a> 开箱即用的中后台前端解决方案
- 感谢 [Gi Admin Pro](https://gitee.com/lin0716/gi-demo),致敬各位作者为开源前端模板领域作出的贡献
- e.g. 扩展于 Gi Admin Pro 项目开源的文件管理组件
@@ -331,5 +334,5 @@ ContiNew Admin 的分支目前分为下个大版本的开发分支和上个大
## License
- 遵循 <a href="https://github.com/Charles7c/continew-admin-ui/blob/dev/LICENSE" target="_blank">Apache-2.0</a> 开源许可协议
- 遵循 <a href="https://github.com/Charles7c/continew-admin-ui-arco/blob/dev/LICENSE" target="_blank">Apache-2.0</a> 开源许可协议
- Copyright © 2022-present <a href="https://blog.charles7c.top" target="_blank">Charles7c</a>

View File

@@ -1,7 +1,7 @@
{
"name": "continew-admin-ui",
"description": "ContiNew AdminContinue New Admin持续迭代优化的前后端分离中后台管理系统框架开箱即用持续提供舒适的开发体验。",
"version": "2.3.0",
"version": "2.5.0",
"private": true,
"author": "Charles7c",
"license": "Apache-2.0",

View File

@@ -49,8 +49,12 @@ export function listRoute() {
return axios.get<RouteRecordNormalized[]>(`${BASE_URL}/route`);
}
export interface SocialAuthAuthorizeResp {
authorizeUrl: string;
}
export function socialAuth(source: string) {
return axios.get<string>(`/oauth/${source}`);
return axios.get<SocialAuthAuthorizeResp>(`/oauth/${source}`);
}
export function socialLogin(source: string, req: any) {

View File

@@ -35,6 +35,7 @@ export interface SystemLogRecord extends LogRecord {
}
export interface SystemLogDetailRecord extends SystemLogRecord {
traceId: string;
requestHeaders: string;
requestBody: string;
responseHeaders: string;

View File

@@ -7,6 +7,7 @@ export interface DataRecord {
id?: number;
username?: string;
nickname?: string;
password?: string;
gender?: number;
email?: string;
phone?: string;
@@ -25,6 +26,10 @@ export interface DataRecord {
disabled?: boolean;
}
export interface UserResetReq {
newPassword: string;
}
export interface ListParam {
username?: string;
status?: number;
@@ -64,8 +69,8 @@ export function del(ids: number | Array<number>) {
return axios.delete(`${BASE_URL}/${ids}`);
}
export function resetPassword(id: number) {
return axios.patch(`${BASE_URL}/${id}/password`);
export function resetPassword(req: UserResetReq, id: number) {
return axios.patch(`${BASE_URL}/${id}/password`, req);
}
export interface UpdateUserRoleReq {

View File

@@ -1,7 +1,7 @@
import axios from 'axios';
import qs from 'query-string';
const BASE_URL = '/tool/generator';
const BASE_URL = '/generator';
export interface TableRecord {
tableName: string;
@@ -10,6 +10,7 @@ export interface TableRecord {
charset: string;
createTime?: string;
isConfiged: boolean;
disabled: boolean;
}
export interface TableParam {
@@ -36,6 +37,7 @@ export interface FieldConfigRecord {
columnType: string;
fieldName: string;
fieldType: string;
fieldSort: number;
comment: string;
isRequired: boolean;
showInList: boolean;
@@ -56,7 +58,6 @@ export interface GenConfigRecord {
tableName: string;
moduleName: string;
packageName: string;
frontendPath: string;
businessName: string;
author: string;
tablePrefix: string;
@@ -87,6 +88,10 @@ export function preview(tableName: string) {
return axios.get<GeneratePreviewRecord[]>(`${BASE_URL}/preview/${tableName}`);
}
export function generate(tableName: string) {
return axios.post(`${BASE_URL}/${tableName}`);
export function generate(tableNames: Array<string>) {
return axios.request({
url: `${BASE_URL}/${tableNames}`,
method: 'post',
responseType: 'blob',
});
}

View File

@@ -46,6 +46,9 @@ axios.interceptors.response.use(
) {
return response;
}
if (response.config.responseType === 'blob') {
return response;
}
const res = response.data;
if (res.success) {
return res;

View File

@@ -169,15 +169,18 @@
margin-top: 16px;
.arco-input-wrapper,
:deep(.arco-select-view-single) {
background-color: var(--color-bg-white);
border: 1px solid var(--color-border-3);
background-color: #fff;
border: 1px solid #c9cdd4;
height: 40px;
border-radius: 4px;
font-size: 13px;
}
.arco-input-wrapper.arco-input-error {
background-color: var(--color-danger-light-1);
border-color: var(--color-danger-light-4);
background-color: rgb(255, 236, 232);
border-color: rgb(249, 137, 129);
}
.arco-input-wrapper :deep(.arco-input) {
color: rgb(29, 33, 41);
}
.captcha {

View File

@@ -9,6 +9,7 @@
const { t } = useI18n();
const router = useRouter();
const userStore = useUserStore();
const formRef = ref();
const loading = ref(false);
const captchaLoading = ref(false);
const captchaDisable = ref(false);
@@ -47,7 +48,7 @@
*/
const handleSendCaptcha = () => {
if (captchaLoading.value) return;
proxy.$refs.formRef.validateField('email', (valid: any) => {
formRef.value.validateField('email', (valid: any) => {
if (!valid) {
captchaLoading.value = true;
captchaBtnNameKey.value = 'login.captcha.ing';
@@ -165,15 +166,18 @@
margin-top: 16px;
.arco-input-wrapper,
:deep(.arco-select-view-single) {
background-color: var(--color-bg-white);
border: 1px solid var(--color-border-3);
background-color: #fff;
border: 1px solid #c9cdd4;
height: 40px;
border-radius: 4px;
font-size: 13px;
}
.arco-input-wrapper.arco-input-error {
background-color: var(--color-danger-light-1);
border-color: var(--color-danger-light-4);
background-color: rgb(255, 236, 232);
border-color: rgb(249, 137, 129);
}
.arco-input-wrapper :deep(.arco-input) {
color: rgb(29, 33, 41);
}
.captcha-btn {
@@ -190,7 +194,7 @@
}
.arco-btn-secondary:not(.arco-btn-disabled):hover {
background-color: transparent;
border: 1px solid rgb(var(--primary-6));
border: 1px solid rgb(22, 93, 255);
}
.btn {

View File

@@ -9,6 +9,7 @@
const { t } = useI18n();
const router = useRouter();
const userStore = useUserStore();
const formRef = ref();
const loading = ref(false);
const captchaLoading = ref(false);
const captchaDisable = ref(true);
@@ -43,7 +44,7 @@
*/
const handleOpenBehaviorCaptcha = () => {
if (captchaLoading.value) return;
proxy.$refs.formRef.validateField('phone', (valid: any) => {
formRef.value.validateField('phone', (valid: any) => {
if (!valid) {
proxy.$refs.verifyRef.show();
}
@@ -65,7 +66,7 @@
*/
const handleSendCaptcha = (captchaParam: BehaviorCaptchaReq) => {
if (captchaLoading.value) return;
proxy.$refs.formRef.validateField('phone', (valid: any) => {
formRef.value.validateField('phone', (valid: any) => {
if (!valid) {
captchaLoading.value = true;
captchaBtnNameKey.value = 'login.captcha.ing';
@@ -197,15 +198,18 @@
margin-top: 16px;
.arco-input-wrapper,
:deep(.arco-select-view-single) {
background-color: var(--color-bg-white);
border: 1px solid var(--color-border-3);
background-color: #fff;
border: 1px solid #c9cdd4;
height: 40px;
border-radius: 4px;
font-size: 13px;
}
.arco-input-wrapper.arco-input-error {
background-color: var(--color-danger-light-1);
border-color: var(--color-danger-light-4);
background-color: rgb(255, 236, 232);
border-color: rgb(249, 137, 129);
}
.arco-input-wrapper :deep(.arco-input) {
color: rgb(29, 33, 41);
}
.captcha-btn {
@@ -220,9 +224,14 @@
border: 1px solid #dde2e9;
color: #41464f;
}
.arco-btn-secondary.arco-btn-disabled,
.arco-btn-secondary[type='submit'].arco-btn-disabled {
color: #c9cdd4;
background-color: rgb(247, 248, 250);
}
.arco-btn-secondary:not(.arco-btn-disabled):hover {
background-color: transparent;
border: 1px solid rgb(var(--primary-6));
border: 1px solid rgb(22, 93, 255);
}
.btn {
@@ -240,10 +249,11 @@
.arco-btn-primary.arco-btn-disabled,
.arco-btn-primary[type='submit'].arco-btn-disabled {
background-color: var(--color-neutral-4);
color: #fff;
background-color: rgb(201, 205, 212);
box-shadow:
0 0 0 1px var(--color-neutral-4),
0 2px 1px rgba(0, 0, 0, 0.15);
0 0 0 1px rgb(201, 205, 212),
0 2px 1px #00000026;
}
}
</style>

View File

@@ -17,7 +17,7 @@
*/
const handleSocialAuth = async (source: string) => {
const { data } = await socialAuth(source);
window.location.href = data;
window.location.href = data.authorizeUrl;
};
const toggleLoginMode = () => {
@@ -124,7 +124,7 @@
display: inline-block;
margin-right: 4px;
margin-left: 4px;
color: var(--color-text-1);
color: #1d2129;
font-size: 24px;
vertical-align: middle;
}
@@ -189,16 +189,23 @@
position: relative;
}
:deep(.arco-tabs-tab-title:hover) {
color: rgb(var(--primary-6));
color: rgb(22, 93, 255);
}
:deep(.arco-tabs-tab-title:before) {
display: none;
}
:deep(.arco-tabs-tab) {
margin: 0 30px 0 6px;
color: rgb(78, 89, 105);
}
}
:deep(.arco-checkbox-label) {
color: #1d2129;
}
:deep(.arco-select-view-single) {
color: #1d2129;
}
.oauth {
margin-top: 20px;
padding: 0 5px;
@@ -207,6 +214,10 @@
font-size: 12px;
font-weight: 400;
line-height: 20px;
background: #fff;
}
:deep(.arco-divider-horizontal) {
border-bottom: 1px solid rgb(229, 230, 235);
}
:deep(.arco-divider) {
margin-bottom: 25px;
@@ -259,11 +270,11 @@
}
.mail:hover,
.account:hover {
color: rgb(var(--primary-6));
color: rgb(22, 93, 255);
}
.mail svg:hover,
.account svg:hover {
color: rgb(var(--primary-6));
color: rgb(22, 93, 255);
}
}
}

View File

@@ -10,6 +10,7 @@
'success_failure_status_enum',
);
const queryFormRef = ref();
const loginLogList = ref<LoginLogRecord[]>([]);
const total = ref(0);
const loading = ref(false);
@@ -55,7 +56,7 @@
* 重置
*/
const resetQuery = () => {
proxy.$refs.queryRef.resetFields();
queryFormRef.value.resetFields();
handleQuery();
};
@@ -94,7 +95,7 @@
<div class="header">
<!-- 搜索栏 -->
<div class="header-query">
<a-form ref="queryRef" :model="queryParams" layout="inline">
<a-form ref="queryFormRef" :model="queryParams" layout="inline">
<a-form-item field="status" hide-label>
<a-select
v-model="queryParams.status"

View File

@@ -10,6 +10,7 @@
'success_failure_status_enum'
);
const queryFormRef = ref();
const operationLogList = ref<OperationLogRecord[]>([]);
const total = ref(0);
const loading = ref(false);
@@ -56,7 +57,7 @@
* 重置
*/
const resetQuery = () => {
proxy.$refs.queryRef.resetFields();
queryFormRef.value.resetFields();
handleQuery();
};
@@ -95,7 +96,7 @@
<div class="header">
<!-- 搜索栏 -->
<div class="header-query">
<a-form ref="queryRef" :model="queryParams" layout="inline">
<a-form ref="queryFormRef" :model="queryParams" layout="inline">
<a-form-item field="description" hide-label>
<a-input
v-model="queryParams.description"

View File

@@ -12,8 +12,10 @@
const { proxy } = getCurrentInstance() as any;
const { copy, copied } = useClipboard();
const queryFormRef = ref();
const systemLogList = ref<SystemLogRecord[]>([]);
const systemLog = ref<SystemLogDetailRecord>({
traceId: '',
requestUrl: '',
requestMethod: '',
requestHeaders: '',
@@ -35,6 +37,7 @@
const data = reactive({
// 查询参数
queryParams: {
traceId: undefined,
createTime: undefined,
page: 1,
size: 10,
@@ -110,7 +113,7 @@
* 重置
*/
const resetQuery = () => {
proxy.$refs.queryRef.resetFields();
queryFormRef.value.resetFields();
handleQuery();
};
@@ -149,7 +152,7 @@
<div class="header">
<!-- 搜索栏 -->
<div class="header-query">
<a-form ref="queryRef" :model="queryParams" layout="inline">
<a-form ref="queryFormRef" :model="queryParams" layout="inline">
<a-form-item field="createTime" hide-label>
<date-range-picker v-model="queryParams.createTime" />
</a-form-item>
@@ -335,6 +338,18 @@
/>
</span>
</a-descriptions-item>
<a-descriptions-item label="Trace ID" :span="2">
<a-skeleton v-if="loading" :animation="true">
<a-skeleton-line :rows="1" />
</a-skeleton>
<span v-else>
{{ systemLog.traceId }}
<icon-copy
class="copy-btn"
@click="handleCopy(systemLog.traceId)"
/>
</span>
</a-descriptions-item>
</a-descriptions>
<a-descriptions
layout="inline-vertical"

View File

@@ -4,7 +4,8 @@
import checkPermission from '@/utils/permission';
const { proxy } = getCurrentInstance() as any;
const queryFormRef = ref();
const tableRef = ref();
const dataList = ref<DataRecord[]>([]);
const total = ref(0);
const loading = ref(false);
@@ -63,7 +64,7 @@
* 重置
*/
const resetQuery = () => {
proxy.$refs.queryRef.resetFields();
queryFormRef.value.resetFields();
handleQuery();
};
@@ -102,7 +103,7 @@
<div class="header">
<!-- 搜索栏 -->
<div class="header-query">
<a-form ref="queryRef" :model="queryParams" layout="inline">
<a-form ref="queryFormRef" :model="queryParams" layout="inline">
<a-form-item field="nickname" hide-label>
<a-input
v-model="queryParams.nickname"

View File

@@ -16,6 +16,9 @@
'announcement_status_enum',
);
const queryFormRef = ref();
const formRef = ref();
const tableRef = ref();
const dataList = ref<DataRecord[]>([]);
const dataDetail = ref<DataRecord>({});
const total = ref(0);
@@ -97,7 +100,7 @@
*/
const reset = () => {
form.value = {};
proxy.$refs.formRef?.resetFields();
formRef.value?.resetFields();
};
/**
@@ -105,14 +108,14 @@
*/
const handleCancel = () => {
visible.value = false;
proxy.$refs.formRef.resetFields();
formRef.value.resetFields();
};
/**
* 确定
*/
const handleOk = () => {
proxy.$refs.formRef.validate((valid: any) => {
formRef.value.validate((valid: any) => {
if (!valid) {
if (form.value.id !== undefined) {
update(form.value, form.value.id).then((res) => {
@@ -185,7 +188,7 @@
del(ids).then((res) => {
proxy.$message.success(res.msg);
getList();
proxy.$refs.tableRef.selectAll(false);
tableRef.value.selectAll(false);
});
};
@@ -228,7 +231,7 @@
* 重置
*/
const resetQuery = () => {
proxy.$refs.queryRef.resetFields();
queryFormRef.value.resetFields();
handleQuery();
};
@@ -267,7 +270,7 @@
<div class="header">
<!-- 搜索栏 -->
<div v-if="showQuery" class="header-query">
<a-form ref="queryRef" :model="queryParams" layout="inline">
<a-form ref="queryFormRef" :model="queryParams" layout="inline">
<a-form-item field="title" hide-label>
<a-input
v-model="queryParams.title"

View File

@@ -12,6 +12,7 @@
import { useAppStore } from '@/store';
const { proxy } = getCurrentInstance() as any;
const formRef = ref();
const dataList = ref<DataRecord[]>([]);
const isEdit = ref(false);
const logoFile = ref<FileItem>({ uid: '-1' });
@@ -81,7 +82,7 @@
* 保存
*/
const handleSave = () => {
proxy.$refs.formRef.validate((valid: any) => {
formRef.value.validate((valid: any) => {
if (!valid) {
const optionList: DataRecord[] = Object.entries(form.value).map(
(item) => {
@@ -121,7 +122,7 @@
upload(formData)
.then((res) => {
onSuccess(res);
form.value.site_logo = res.data;
form.value.site_logo = res.data.url;
proxy.$message.success(res.msg);
})
.catch((error) => {
@@ -156,7 +157,7 @@
upload(formData)
.then((res) => {
onSuccess(res);
form.value.site_favicon = res.data;
form.value.site_favicon = res.data.url;
proxy.$message.success(res.msg);
})
.catch((error) => {

View File

@@ -15,6 +15,9 @@
const { proxy } = getCurrentInstance() as any;
const { dis_enable_status_enum } = proxy.useDict('dis_enable_status_enum');
const queryFormRef = ref();
const formRef = ref();
const tableRef = ref();
const dataList = ref<DataRecord[]>([]);
const dataDetail = ref<DataRecord>({});
const ids = ref<Array<number>>([]);
@@ -64,7 +67,7 @@
.then((res) => {
dataList.value = res.data;
setTimeout(() => {
proxy.$refs.tableRef.expandAll();
tableRef.value.expandAll();
}, 0);
})
.finally(() => {
@@ -110,7 +113,7 @@
form.value = {
sort: 999,
};
proxy.$refs.formRef?.resetFields();
formRef.value?.resetFields();
};
/**
@@ -118,14 +121,14 @@
*/
const handleCancel = () => {
visible.value = false;
proxy.$refs.formRef.resetFields();
formRef.value.resetFields();
};
/**
* 确定
*/
const handleOk = () => {
proxy.$refs.formRef.validate((valid: any) => {
formRef.value.validate((valid: any) => {
if (!valid) {
if (form.value.id !== undefined) {
update(form.value, form.value.id).then((res) => {
@@ -197,7 +200,7 @@
del(ids).then((res) => {
proxy.$message.success(res.msg);
getList();
proxy.$refs.tableRef.selectAll(false);
tableRef.value.selectAll(false);
});
};
@@ -208,7 +211,7 @@
if (rowKeys.find((key: any) => key === rowKey)) {
if (record.children) {
record.children.forEach((r) => {
proxy.$refs.tableRef.select(r.id);
tableRef.value.select(r.id);
rowKeys.push(r.id);
if (r.children) {
handleSelect(rowKeys, rowKey, r);
@@ -221,7 +224,7 @@
rowKeys.findIndex((key: number | undefined) => key === r.id),
1,
);
proxy.$refs.tableRef.select(r.id, false);
tableRef.value.select(r.id, false);
if (r.children) {
handleSelect(rowKeys, rowKey, r);
}
@@ -297,7 +300,7 @@
* 重置
*/
const resetQuery = () => {
proxy.$refs.queryRef.resetFields();
queryFormRef.value.resetFields();
handleQuery();
};
</script>
@@ -316,7 +319,7 @@
<div class="header">
<!-- 搜索栏 -->
<div v-if="showQuery" class="header-query">
<a-form ref="queryRef" :model="queryParams" layout="inline">
<a-form ref="queryFormRef" :model="queryParams" layout="inline">
<a-form-item field="name" hide-label>
<a-input
v-model="queryParams.name"

View File

@@ -14,6 +14,9 @@
const { proxy } = getCurrentInstance() as any;
const queryFormRef = ref();
const formRef = ref();
const tableRef = ref();
const dataList = ref<DataRecord[]>([]);
const total = ref(0);
const ids = ref<Array<number>>([]);
@@ -129,7 +132,7 @@
*/
const reset = () => {
form.value = {};
proxy.$refs.formRef?.resetFields();
formRef.value?.resetFields();
};
/**
@@ -137,14 +140,14 @@
*/
const handleCancel = () => {
visible.value = false;
proxy.$refs.formRef.resetFields();
formRef.value.resetFields();
};
/**
* 确定
*/
const handleOk = () => {
proxy.$refs.formRef.validate((valid: any) => {
formRef.value.validate((valid: any) => {
if (!valid) {
if (form.value.id !== undefined) {
update(form.value, form.value.id).then((res) => {
@@ -191,7 +194,7 @@
del(ids).then((res) => {
proxy.$message.success(res.msg);
getList();
proxy.$refs.tableRef.selectAll(false);
tableRef.value.selectAll(false);
});
};
@@ -223,7 +226,7 @@
* 查询
*/
const handleQuery = () => {
proxy.$refs.tableRef.selectAll(false);
tableRef.value.selectAll(false);
getList();
};
@@ -231,7 +234,7 @@
* 重置
*/
const resetQuery = () => {
proxy.$refs.queryRef.resetFields();
queryFormRef.value.resetFields();
handleQuery();
};
@@ -272,7 +275,7 @@
<div class="header">
<!-- 搜索栏 -->
<div v-if="showQuery" class="header-query">
<a-form ref="queryRef" :model="queryParams" layout="inline">
<a-form ref="queryFormRef" :model="queryParams" layout="inline">
<a-form-item field="name" hide-label>
<a-input
v-model="queryParams.name"

View File

@@ -17,6 +17,8 @@
},
});
const { proxy } = getCurrentInstance() as any;
const formRef = ref();
const tableRef = ref();
const dataList = ref<DataRecord[]>([]);
const colors = ref(['primary', 'success', 'warning', 'error', 'default']);
const total = ref(0);
@@ -95,7 +97,7 @@
sort: 999,
dictId: dictId.value,
};
proxy.$refs.formRef?.resetFields();
formRef.value?.resetFields();
};
/**
@@ -103,14 +105,14 @@
*/
const handleCancel = () => {
visible.value = false;
proxy.$refs.formRef.resetFields();
formRef.value.resetFields();
};
/**
* 确定
*/
const handleOk = () => {
proxy.$refs.formRef.validate((valid: any) => {
formRef.value.validate((valid: any) => {
if (!valid) {
if (form.value.id !== undefined) {
update(form.value, form.value.id).then((res) => {

View File

@@ -28,6 +28,7 @@
const { proxy } = getCurrentInstance() as any;
const route = useRoute();
const fileStore = useFileStore();
const queryFormRef = ref();
const loading = ref(false);
// 文件列表数据
const fileList = ref<FileItem[]>([]);
@@ -212,7 +213,7 @@
* 重置
*/
const resetQuery = () => {
proxy.$refs.queryRef.resetFields();
queryFormRef.value.resetFields();
handleQuery();
};
@@ -393,7 +394,7 @@
<a-row justify="space-between" class="row-operate">
<!-- 左侧区域 -->
<a-space wrap>
<a-form ref="queryRef" :model="queryParams" layout="inline">
<a-form ref="queryFormRef" :model="queryParams" layout="inline">
<a-form-item hide-label>
<a-upload
v-permission="['system:file:upload']"
@@ -449,6 +450,14 @@
isBatchMode ? '取消批量' : '批量操作'
}}</template>
</a-button>
<a-button
v-permission="['system:storage:list']"
type="primary"
@click="handleConfig"
>
<template #icon><icon-settings /></template>
<template #default>配置存储库</template>
</a-button>
<a-button-group>
<a-tooltip content="视图" position="bottom">
<a-button @click="fileStore.changeViewMode">
@@ -458,16 +467,6 @@
</template>
</a-button>
</a-tooltip>
<a-tooltip content="配置存储库" position="bottom">
<a-button
v-permission="['system:storage:list']"
@click="handleConfig"
>
<template #icon>
<icon-settings />
</template>
</a-button>
</a-tooltip>
</a-button-group>
</a-space>
</a-row>

View File

@@ -15,6 +15,9 @@
const { proxy } = getCurrentInstance() as any;
const { dis_enable_status_enum } = proxy.useDict('dis_enable_status_enum');
const queryFormRef = ref();
const formRef = ref();
const tableRef = ref();
const dataList = ref<DataRecord[]>([]);
const ids = ref<Array<number>>([]);
const title = ref('');
@@ -107,7 +110,7 @@
isHidden: false,
sort: 999,
};
proxy.$refs.formRef?.resetFields();
formRef.value?.resetFields();
};
/**
@@ -115,14 +118,14 @@
*/
const handleCancel = () => {
visible.value = false;
proxy.$refs.formRef.resetFields();
formRef.value.resetFields();
};
/**
* 确定
*/
const handleOk = () => {
proxy.$refs.formRef.validate((valid: any) => {
formRef.value.validate((valid: any) => {
if (!valid) {
if (form.value.id !== undefined) {
update(form.value, form.value.id).then((res) => {
@@ -170,7 +173,7 @@
del(ids).then((res) => {
proxy.$message.success(res.msg);
getList();
proxy.$refs.tableRef.selectAll(false);
tableRef.value.selectAll(false);
});
};
@@ -181,7 +184,7 @@
if (rowKeys.find((key: any) => key === rowKey)) {
if (record.children) {
record.children.forEach((r) => {
proxy.$refs.tableRef.select(r.id);
tableRef.value.select(r.id);
rowKeys.push(r.id);
if (r.children) {
handleSelect(rowKeys, rowKey, r);
@@ -194,7 +197,7 @@
rowKeys.findIndex((key: number | undefined) => key === r.id),
1,
);
proxy.$refs.tableRef.select(r.id, false);
tableRef.value.select(r.id, false);
if (r.children) {
handleSelect(rowKeys, rowKey, r);
}
@@ -231,7 +234,7 @@
*/
const handleExpandAll = () => {
expandAll.value = !expandAll.value;
proxy.$refs.tableRef.expandAll(expandAll.value);
tableRef.value.expandAll(expandAll.value);
};
/**
@@ -300,7 +303,7 @@
* 重置
*/
const resetQuery = () => {
proxy.$refs.queryRef.resetFields();
queryFormRef.value.resetFields();
handleQuery();
};
</script>
@@ -320,7 +323,7 @@
<div class="header">
<!-- 搜索栏 -->
<div v-if="showQuery" class="header-query">
<a-form ref="queryRef" :model="queryParams" layout="inline">
<a-form ref="queryFormRef" :model="queryParams" layout="inline">
<a-form-item field="title" hide-label>
<a-input
v-model="queryParams.title"

View File

@@ -3,6 +3,8 @@
const { proxy } = getCurrentInstance() as any;
const { message_type_enum } = proxy.useDict('message_type_enum');
const queryFormRef = ref();
const tableRef = ref();
const dataList = ref<DataRecord[]>([]);
const dataDetail = ref<DataRecord>({
id: 0,
@@ -99,7 +101,7 @@
del(ids).then((res) => {
proxy.$message.success(res.msg);
getList();
proxy.$refs.tableRef.selectAll(false);
tableRef.value.selectAll(false);
});
};
@@ -130,7 +132,7 @@
read(ids).then((res) => {
proxy.$message.success(res.msg);
getList();
proxy.$refs.tableRef.selectAll(false);
tableRef.value.selectAll(false);
});
};
@@ -160,7 +162,7 @@
* 重置
*/
const resetQuery = () => {
proxy.$refs.queryRef.resetFields();
queryFormRef.value.resetFields();
handleQuery();
};
@@ -199,7 +201,7 @@
<div class="header">
<!-- 搜索栏 -->
<div v-if="showQuery" class="header-query">
<a-form ref="queryRef" :model="queryParams" layout="inline">
<a-form ref="queryFormRef" :model="queryParams" layout="inline">
<a-form-item field="title" hide-label>
<a-input
v-model="queryParams.title"

View File

@@ -18,6 +18,9 @@
'dis_enable_status_enum',
);
const queryFormRef = ref();
const formRef = ref();
const tableRef = ref();
const dataList = ref<DataRecord[]>([]);
const dataDetail = ref<DataRecord>({});
const total = ref(0);
@@ -170,7 +173,7 @@
dataScope: 4,
sort: 999,
};
proxy.$refs.formRef?.resetFields();
formRef.value?.resetFields();
};
/**
@@ -178,7 +181,7 @@
*/
const handleCancel = () => {
visible.value = false;
proxy.$refs.formRef.resetFields();
formRef.value.resetFields();
};
/**
@@ -224,7 +227,7 @@
* 确定
*/
const handleOk = () => {
proxy.$refs.formRef.validate((valid: any) => {
formRef.value.validate((valid: any) => {
if (!valid) {
if (form.value.id !== undefined) {
form.value.menuIds = getMenuAllCheckedKeys();
@@ -302,7 +305,7 @@
del(ids).then((res) => {
proxy.$message.success(res.msg);
getList();
proxy.$refs.tableRef.selectAll(false);
tableRef.value.selectAll(false);
});
};
@@ -385,7 +388,7 @@
* 重置
*/
const resetQuery = () => {
proxy.$refs.queryRef.resetFields();
queryFormRef.value.resetFields();
handleQuery();
};
@@ -424,7 +427,7 @@
<div class="header">
<!-- 搜索栏 -->
<div v-if="showQuery" class="header-query">
<a-form ref="queryRef" :model="queryParams" layout="inline">
<a-form ref="queryFormRef" :model="queryParams" layout="inline">
<a-form-item field="name" hide-label>
<a-input
v-model="queryParams.name"
@@ -534,7 +537,11 @@
@selection-change="handleSelectionChange"
>
<template #columns>
<a-table-column title="ID" data-index="id" />
<a-table-column title="序号">
<template #cell="{ rowIndex }">
{{ rowIndex + 1 + (queryParams.page - 1) * queryParams.size }}
</template>
</a-table-column>
<a-table-column title="名称" :width="130">
<template #cell="{ record }">
<a-link @click="toDetail(record.id)">{{ record.name }}</a-link>

View File

@@ -7,6 +7,7 @@
const { proxy } = getCurrentInstance() as any;
const { t } = useI18n();
const formRef = ref();
const userStore = useUserStore();
const loading = ref(false);
@@ -46,7 +47,7 @@
*/
const handleSave = () => {
if (loading.value) return;
proxy.$refs.formRef.validate((valid: any) => {
formRef.value.validate((valid: any) => {
if (!valid) {
loading.value = true;
updateBasicInfo({
@@ -68,7 +69,7 @@
* 重置
*/
const handleReset = () => {
proxy.$refs.formRef.resetFields();
formRef.value.resetFields();
};
</script>

View File

@@ -57,7 +57,7 @@
hideCancel: false,
onOk: () => {
socialAuth(source).then((res) => {
window.location.href = res.data;
window.location.href = res.data.authorizeUrl;
});
},
});

View File

@@ -9,6 +9,7 @@
const { proxy } = getCurrentInstance() as any;
const { t } = useI18n();
const userStore = useUserStore();
const formRef = ref();
const captchaTime = ref(60);
const captchaTimer = ref();
const captchaLoading = ref(false);
@@ -72,7 +73,7 @@
*/
const handleSendCaptcha = () => {
if (captchaLoading.value) return;
proxy.$refs.formRef.validateField('newEmail', (valid: any) => {
formRef.value.validateField('newEmail', (valid: any) => {
if (!valid) {
captchaLoading.value = true;
captchaBtnNameKey.value = 'userCenter.securitySettings.captcha.ing';
@@ -107,7 +108,7 @@
*/
const handleCancel = () => {
visible.value = false;
proxy.$refs.formRef.resetFields();
formRef.value.resetFields();
resetCaptcha();
};
@@ -115,7 +116,7 @@
* 修改
*/
const handleUpdate = () => {
proxy.$refs.formRef.validate((valid: any) => {
formRef.value.validate((valid: any) => {
if (!valid) {
updateEmail({
newEmail: form.newEmail,

View File

@@ -9,6 +9,7 @@
const { proxy } = getCurrentInstance() as any;
const { t } = useI18n();
const userStore = useUserStore();
const formRef = ref();
const captchaTime = ref(60);
const captchaTimer = ref();
const captchaLoading = ref(false);
@@ -74,7 +75,7 @@
*/
const handleOpenBehaviorCaptcha = () => {
if (captchaLoading.value) return;
proxy.$refs.formRef.validateField('newPhone', (valid: any) => {
formRef.value.validateField('newPhone', (valid: any) => {
if (!valid) {
proxy.$refs.verifyRef.show();
}
@@ -86,7 +87,7 @@
*/
const handleSendCaptcha = (captchaParam: BehaviorCaptchaReq) => {
if (captchaLoading.value) return;
proxy.$refs.formRef.validateField('newPhone', (valid: any) => {
formRef.value.validateField('newPhone', (valid: any) => {
if (!valid) {
captchaLoading.value = true;
captchaBtnNameKey.value = 'userCenter.securitySettings.captcha.ing';
@@ -121,7 +122,7 @@
*/
const handleCancel = () => {
visible.value = false;
proxy.$refs.formRef.resetFields();
formRef.value.resetFields();
resetCaptcha();
};
@@ -129,7 +130,7 @@
* 修改
*/
const handleUpdate = () => {
proxy.$refs.formRef.validate((valid: any) => {
formRef.value.validate((valid: any) => {
if (!valid) {
updatePhone({
newPhone: form.newPhone,

View File

@@ -9,6 +9,7 @@
const { t } = useI18n();
const userStore = useUserStore();
const formRef = ref();
const visible = ref(false);
// 表单数据
@@ -68,7 +69,7 @@
callback(
t(
'userCenter.securitySettings.updatePwd.form.error.validator.rePassword'
)
),
);
} else {
callback();
@@ -84,14 +85,14 @@
*/
const handleCancel = () => {
visible.value = false;
proxy.$refs.formRef.resetFields();
formRef.value.resetFields();
};
/**
* 修改
*/
const handleUpdate = () => {
proxy.$refs.formRef.validate((valid: any) => {
formRef.value.validate((valid: any) => {
if (!valid) {
updatePassword({
oldPassword: encryptByRsa(form.oldPassword) || '',

View File

@@ -3,6 +3,7 @@
import {
DataRecord,
ListParam,
UserResetReq,
list,
get,
add,
@@ -15,10 +16,14 @@
import { LabelValueState } from '@/store/modules/dict/types';
import getAvatar from '@/utils/avatar';
import checkPermission from '@/utils/permission';
import { encryptByRsa } from '@/utils/encrypt';
const { proxy } = getCurrentInstance() as any;
const { dis_enable_status_enum } = proxy.useDict('dis_enable_status_enum');
const queryFormRef = ref();
const formRef = ref();
const tableRef = ref();
const dataList = ref<DataRecord[]>([]);
const dataDetail = ref<DataRecord>({});
const total = ref(0);
@@ -31,6 +36,7 @@
const detailLoading = ref(false);
const exportLoading = ref(false);
const visible = ref(false);
const resetPasswordVisible = ref(false);
const userRoleVisible = ref(false);
const detailVisible = ref(false);
const deptLoading = ref(false);
@@ -53,15 +59,17 @@
},
// 表单数据
form: {} as DataRecord,
userResetReq: {} as UserResetReq,
// 表单验证规则
rules: {
username: [{ required: true, message: '请输入用户名' }],
nickname: [{ required: true, message: '请输入昵称' }],
password: [{ required: true, message: '请输入密码' }],
deptId: [{ required: true, message: '请选择所属部门' }],
roleIds: [{ required: true, message: '请选择所属角色' }],
},
});
const { queryParams, form, rules } = toRefs(data);
const { queryParams, form, userResetReq, rules } = toRefs(data);
/**
* 查询部门树
@@ -126,6 +134,17 @@
});
};
/**
* 打开重置密码对话框
*
* @param id ID
*/
const toResetPassword = (id: number) => {
reset();
form.value.id = id;
resetPasswordVisible.value = true;
};
/**
* 打开分配角色对话框
*
@@ -175,7 +194,7 @@
form.value = {
gender: 1,
};
proxy.$refs.formRef?.resetFields();
formRef.value?.resetFields();
};
/**
@@ -183,8 +202,10 @@
*/
const handleCancel = () => {
visible.value = false;
resetPasswordVisible.value = false;
userRoleVisible.value = false;
proxy.$refs.formRef?.resetFields();
formRef.value?.resetFields();
proxy.$refs.resetPasswordFormRef?.resetFields();
proxy.$refs.userRoleFormRef?.resetFields();
};
@@ -192,7 +213,7 @@
* 确定
*/
const handleOk = () => {
proxy.$refs.formRef.validate((valid: any) => {
formRef.value.validate((valid: any) => {
if (!valid) {
if (form.value.id !== undefined) {
update(form.value, form.value.id).then((res) => {
@@ -201,12 +222,41 @@
proxy.$message.success(res.msg);
});
} else {
add(form.value).then((res) => {
const rawPassword = form.value.password;
if (rawPassword) {
form.value.password = encryptByRsa(rawPassword) || '';
}
add(form.value)
.then((res) => {
handleCancel();
getList();
proxy.$message.success(res.msg);
})
.catch(() => {
form.value.password = rawPassword;
});
}
}
});
};
/**
* 重置密码
*/
const handleResetPassword = () => {
proxy.$refs.resetPasswordFormRef.validate((valid: any) => {
if (!valid && form.value.id !== undefined) {
const rawPassword = form.value.password;
if (rawPassword) {
userResetReq.value.newPassword = encryptByRsa(rawPassword) || '';
}
resetPassword(userResetReq.value, form.value.id)
.then((res) => {
handleCancel();
getList();
proxy.$message.success(res.msg);
});
}
})
.catch();
}
});
};
@@ -281,18 +331,7 @@
del(ids).then((res) => {
proxy.$message.success(res.msg);
getList();
proxy.$refs.tableRef.selectAll(false);
});
};
/**
* 重置密码
*
* @param id ID
*/
const handleResetPassword = (id: number) => {
resetPassword(id).then((res) => {
proxy.$message.success(res.msg);
tableRef.value.selectAll(false);
});
};
@@ -388,7 +427,7 @@
* 重置
*/
const resetQuery = () => {
proxy.$refs.queryRef.resetFields();
queryFormRef.value.resetFields();
handleQuery();
};
@@ -451,7 +490,7 @@
<div class="header">
<!-- 搜索栏 -->
<div v-if="showQuery" class="header-query">
<a-form ref="queryRef" :model="queryParams" layout="inline">
<a-form ref="queryFormRef" :model="queryParams" layout="inline">
<a-form-item field="username" hide-label>
<a-input
v-model="queryParams.username"
@@ -570,7 +609,11 @@
@selection-change="handleSelectionChange"
>
<template #columns>
<a-table-column title="ID" data-index="id" />
<a-table-column title="序号">
<template #cell="{ rowIndex }">
{{ rowIndex + 1 + (queryParams.page - 1) * queryParams.size }}
</template>
</a-table-column>
<a-table-column title="用户名" :width="100" ellipsis tooltip>
<template #cell="{ record }">
<a-link @click="toDetail(record.id)">{{
@@ -578,7 +621,13 @@
}}</a-link>
</template>
</a-table-column>
<a-table-column title="昵称" data-index="nickname" :width="115" ellipsis tooltip />
<a-table-column
title="昵称"
data-index="nickname"
:width="115"
ellipsis
tooltip
/>
<a-table-column title="性别" align="center">
<template #cell="{ record }">
<span v-if="record.gender === 1"></span>
@@ -622,7 +671,12 @@
<a-tag v-else color="arcoblue"></a-tag>
</template>
</a-table-column>
<a-table-column title="描述" data-index="description" ellipsis tooltip />
<a-table-column
title="描述"
data-index="description"
ellipsis
tooltip
/>
<a-table-column title="创建人/创建时间" :width="175">
<template #cell="{ record }">
{{ record.createUserString }}<br />
@@ -668,22 +722,15 @@
<template #icon><icon-delete /></template>
</a-button>
</a-popconfirm>
<a-popconfirm
content="是否确定重置当前用户的密码?"
type="warning"
@ok="handleResetPassword(record.id)"
<a-button
v-permission="['system:user:password:reset']"
type="text"
size="small"
title="重置密码"
@click="toResetPassword(record.id)"
>
<a-button
v-permission="['system:user:password:reset']"
type="text"
size="small"
title="重置密码"
>
<template #icon
><svg-icon icon-class="privacy"
/></template>
</a-button>
</a-popconfirm>
<template #icon><svg-icon icon-class="privacy" /></template>
</a-button>
<a-button
v-permission="['system:user:role:update']"
type="text"
@@ -715,19 +762,11 @@
@ok="handleOk"
@cancel="handleCancel"
>
<a-form
ref="formRef"
:model="form"
:rules="rules"
:label-col-style="{ width: '84px' }"
size="large"
layout="inline"
>
<a-form ref="formRef" :model="form" :rules="rules" size="large">
<a-form-item label="用户名" field="username">
<a-input
v-model="form.username"
placeholder="请输入用户名"
style="width: 162px"
:max-length="64"
/>
</a-form-item>
@@ -736,7 +775,13 @@
v-model="form.nickname"
placeholder="请输入昵称"
:max-length="30"
style="width: 162px"
/>
</a-form-item>
<a-form-item v-if="!form.id" label="密码" field="password">
<a-input-password
v-model="form.password"
placeholder="请输入密码"
:max-length="32"
/>
</a-form-item>
<a-form-item label="邮箱" field="email">
@@ -744,7 +789,6 @@
v-model="form.email"
placeholder="请输入邮箱"
:max-length="255"
style="width: 162px"
/>
</a-form-item>
<a-form-item label="手机号码" field="phone">
@@ -752,11 +796,10 @@
v-model="form.phone"
placeholder="请输入手机号码"
:max-length="15"
style="width: 162px"
/>
</a-form-item>
<a-form-item label="性别" field="gender">
<a-radio-group v-model="form.gender">
<a-radio-group v-model="form.gender" style="width: 197px">
<a-radio :value="1">男</a-radio>
<a-radio :value="2">女</a-radio>
<a-radio :value="0" disabled>未知</a-radio>
@@ -770,7 +813,6 @@
allow-clear
allow-search
:filter-tree-node="filterDeptOptions"
style="width: 431px"
/>
</a-form-item>
<a-form-item
@@ -786,7 +828,6 @@
multiple
allow-clear
:allow-search="{ retainInputValue: true }"
style="width: 431px"
/>
</a-form-item>
<a-form-item label="描述" field="description">
@@ -798,7 +839,32 @@
minRows: 3,
}"
show-word-limit
style="width: 431px"
/>
</a-form-item>
</a-form>
</a-modal>
<a-modal
title="重置密码"
:visible="resetPasswordVisible"
:mask-closable="false"
:esc-to-close="false"
unmount-on-close
render-to-body
@ok="handleResetPassword"
@cancel="handleCancel"
>
<a-form
ref="resetPasswordFormRef"
:model="form"
:rules="rules"
size="large"
>
<a-form-item label="密码" field="password">
<a-input-password
v-model="form.password"
placeholder="请输入密码"
:max-length="32"
/>
</a-form-item>
</a-form>

View File

@@ -18,6 +18,7 @@
preview,
generate,
} from '@/api/tool/generator';
import {TableData} from "@arco-design/web-vue";
const { proxy } = getCurrentInstance() as any;
const { form_type_enum, query_type_enum } = proxy.useDict(
@@ -25,12 +26,18 @@
'query_type_enum',
);
const queryFormRef = ref();
const formRef = ref();
const tableRef = ref();
const { copy, copied } = useClipboard();
const extensions = [java(), javascript()];
const tableList = ref<TableRecord[]>([]);
const fieldConfigList = ref<FieldConfigRecord[]>([]);
const total = ref(0);
const ids = ref<Array<string>>([]);
const title = ref('');
const single = ref(true);
const multiple = ref(true);
const showQuery = ref(true);
const loading = ref(false);
const visible = ref(false);
@@ -78,6 +85,45 @@
};
getList();
/**
* 点击行选择器
*/
const handleSelect = (rowKeys: any, rowKey: any, record: TableData) => {
if (rowKeys.find((key: any) => key === rowKey)) {
if (record.children) {
record.children.forEach((r) => {
tableRef.value.select(r.id);
rowKeys.push(r.id);
if (r.children) {
handleSelect(rowKeys, rowKey, r);
}
});
}
} else if (record.children) {
record.children.forEach((r) => {
rowKeys.splice(
rowKeys.findIndex((key: number | undefined) => key === r.id),
1,
);
tableRef.value.select(r.id, false);
if (r.children) {
handleSelect(rowKeys, rowKey, r);
}
});
}
};
/**
* 已选择的数据行发生改变
*
* @param rowKeys ID 列表
*/
const handleSelectionChange = (rowKeys: Array<any>) => {
ids.value = rowKeys;
single.value = rowKeys.length !== 1;
multiple.value = !rowKeys.length;
};
/**
* 打开配置对话框
*
@@ -129,7 +175,7 @@
* 确定
*/
const handleOk = () => {
proxy.$refs.formRef.validate((valid: any) => {
formRef.value.validate((valid: any) => {
if (!valid) {
config.value.fieldConfigs = fieldConfigList.value;
config.value.genConfig = form.value;
@@ -147,7 +193,7 @@
*/
const handleCancel = () => {
visible.value = false;
proxy.$refs.formRef?.resetFields();
formRef.value.resetFields();
fieldConfigList.value = [];
};
@@ -197,14 +243,44 @@
}
});
/**
* 批量生成代码
*/
const handleBatchGenerate = () => {
if (ids.value.length === 0) {
proxy.$message.info('请选择生成的表数据');
} else {
handleGenerate(ids.value);
}
}
/**
* 生成代码
*
* @param tableName 表名称
* @param tableNames 表名称
*/
const handleGenerate = (tableName: string) => {
generate(tableName).then((res) => {
proxy.$message.success(res.msg);
const handleGenerate = (tableNames: Array<string>) => {
generate(tableNames).then((res) => {
const contentDisposition = res.headers['content-disposition'];
const pattern = new RegExp('filename=([^;]+\\.[^\\.;]+);*');
const result = pattern.exec(contentDisposition) || '';
// 对名字进行解码
const fileName = window.decodeURI(result[1]);
// 创建下载的链接
const blob = new Blob([res.data]);
const downloadElement = document.createElement('a');
const href = window.URL.createObjectURL(blob);
downloadElement.style.display = 'none';
downloadElement.href = href;
// 下载后文件名
downloadElement.download = fileName;
document.body.appendChild(downloadElement);
// 点击下载
downloadElement.click();
// 下载完成,移除元素
document.body.removeChild(downloadElement);
// 释放掉 blob 对象
window.URL.revokeObjectURL(href);
});
};
@@ -219,7 +295,7 @@
* 重置
*/
const resetQuery = () => {
proxy.$refs.queryRef.resetFields();
queryFormRef.value.resetFields();
handleQuery();
};
@@ -254,17 +330,20 @@
<div class="app-container">
<Breadcrumb :items="['menu.tool', 'menu.tool.generator.list']" />
<a-card class="general-card" :title="$t('menu.tool.generator.list')">
<a-alert type="warning" style="margin-bottom: 15px">
默认已开启 Mock下载/导出类操作会出现错误例如下载的文件无法打开点击<a-link href="https://doc.charles7c.top/admin/other/faq.html#%E7%82%B9%E5%87%BB%E5%AF%BC%E5%87%BA%E6%8C%89%E9%92%AE%E6%8A%A5%E9%94%99">查看解决方法</a-link>
</a-alert>
<!-- 头部区域 -->
<div class="header">
<!-- 搜索栏 -->
<div v-if="showQuery" class="header-query">
<a-form ref="queryRef" :model="queryParams" layout="inline">
<a-form ref="queryFormRef" :model="queryParams" layout="inline">
<a-form-item field="tableName" hide-label>
<a-input
v-model="queryParams.tableName"
placeholder="输入表名称搜索"
allow-clear
style="width: 150px"
style="width: 230px"
@press-enter="handleQuery"
/>
</a-form-item>
@@ -276,18 +355,28 @@
<a-button @click="resetQuery">
<template #icon><icon-refresh /></template>重置
</a-button>
<a-button
type="outline"
@click="handleBatchGenerate"
>
<template #icon><icon-robot-add /></template>批量生成
</a-button>
</a-space>
</a-form-item>
</a-form>
</div>
</div>
<!-- 列表区域 -->
<a-table
ref="tableRef"
row-key="tableName"
:data="tableList"
:loading="loading"
:row-selection="{
type: 'checkbox',
showCheckedAll: true,
onlyCurrent: false,
}"
:pagination="{
showTotal: true,
showPageSize: true,
@@ -298,6 +387,8 @@
column-resizable
stripe
size="large"
@select="handleSelect"
@selection-change="handleSelectionChange"
@page-change="handlePageChange"
@page-size-change="handlePageSizeChange"
>
@@ -336,7 +427,7 @@
size="small"
:title="record.isConfiged ? '生成' : '请先进行生成配置'"
:disabled="!record.isConfiged"
@click="handleGenerate(record.tableName)"
@click="handleGenerate([record.tableName])"
>
<template #icon><icon-robot-add /></template>生成
</a-button>
@@ -501,12 +592,6 @@
placeholder="项目模块包名例如top.charles7c.continew.admin.system"
/>
</a-form-item>
<a-form-item label="前端路径" field="frontendPath">
<a-input
v-model="form.frontendPath"
placeholder="前端项目 views 目录地址"
/>
</a-form-item>
<a-form-item label="去表前缀" field="tablePrefix">
<a-input
v-model="form.tablePrefix"
@@ -526,8 +611,8 @@
<!-- 生成预览区域 -->
<a-modal
:body-style="{
paddingTop: 0,
}"
paddingTop: 0,
}"
title="生成预览"
:visible="previewVisible"
width="70%"