Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
9eab97b1c0 | |||
3d528795ff | |||
aa3eaebf6a | |||
![]() |
2353caffa9 | ||
7792cd398f | |||
e6fa9f60a9 | |||
e9d3865892 | |||
aeafc2ece2 | |||
6f5c35ea77 | |||
b4bb4693df | |||
3d32736368 |
56
.github/workflows/deploy.yml
vendored
56
.github/workflows/deploy.yml
vendored
@@ -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
|
23
.github/workflows/release-tag.yml
vendored
23
.github/workflows/release-tag.yml
vendored
@@ -1,23 +0,0 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*' # Push events to matching v*, i.e. v1.0.0
|
||||
|
||||
jobs:
|
||||
release:
|
||||
if: github.repository == 'Charles7c/continew-admin-ui'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
- name: Create Release for Tag
|
||||
id: release_tag
|
||||
uses: yyx990803/release-tag@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
body: |
|
||||
详情请参阅 [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/dev/CHANGELOG.md) 。
|
35
CHANGELOG.md
35
CHANGELOG.md
@@ -1,31 +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/commit/735982373a13889340970623bce544dafc574cdb))
|
||||
* 系统日志详情新增 traceId 链路号显示 ([7359823](https://github.com/Charles7c/continew-admin-ui-arco/commit/735982373a13889340970623bce544dafc574cdb))
|
||||
|
||||
### 💎 功能优化
|
||||
|
||||
- 取消用户默认密码,改为表单填写密码 ([e519d74](https://github.com/Charles7c/continew-admin-ui/commit/e519d746c92596d0b4a568aef26218b8c4c1e4f4)) ([dd1127e](https://github.com/Charles7c/continew-admin-ui/commit/dd1127e2b8ddfad70e67fca5502505fb269236cc))
|
||||
- 部分 ID 列 => 序号列 ([678aa92](https://github.com/Charles7c/continew-admin-ui/commit/678aa92457dc172a300e78e9523ab0fe50715947))
|
||||
- 取消用户默认密码,改为表单填写密码 ([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/commit/65e564dc67c06a18bc543d032d430718ae620cb9))
|
||||
- 修复暗黑模式下返回到登录页面时的部分样式错乱 ([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))
|
||||
|
23
README.md
23
README.md
@@ -1,10 +1,10 @@
|
||||
# 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.4.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" />
|
||||
@@ -33,6 +33,8 @@
|
||||
|
||||
📚 [在线文档](https://doc.charles7c.top) | 🚀 [演示地址](https://cnadmin.charles7c.top)(账号/密码:admin/admin123)
|
||||
|
||||
> 全新 3.0 已经发布,点击[前往](https://gitee.com/continew/continew-admin-ui)
|
||||
|
||||
## 简介
|
||||
|
||||
ContiNew Admin(Continue New Admin)持续迭代优化的前后端分离中后台管理系统框架。开箱即用,持续提供舒适的开发体验,依托开源协作模式,提升技术透明度、放大集体智慧、共创优秀实践,源源不断地为企业级项目开发提供助力。
|
||||
@@ -59,10 +61,11 @@ ContiNew Admin(Continue 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 request(pr),选择好源和目标,按模板要求填写说明信息后提交即可(多多参考 [已批准合并的 pr 记录](https://github.com/Charles7c/continew-admin-ui/pulls?q=is%3Apr+is%3Amerged),会大大增加批准合并率)
|
||||
5. 在 Gitee 或 Github 上新建 pull request(pr),选择好源和目标,按模板要求填写说明信息后提交即可(多多参考 [已批准合并的 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>
|
||||
|
||||
## 鸣谢
|
||||
@@ -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>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "continew-admin-ui",
|
||||
"description": "ContiNew Admin(Continue New Admin)持续迭代优化的前后端分离中后台管理系统框架,开箱即用,持续提供舒适的开发体验。",
|
||||
"version": "2.4.0",
|
||||
"version": "2.5.0",
|
||||
"private": true,
|
||||
"author": "Charles7c",
|
||||
"license": "Apache-2.0",
|
||||
|
@@ -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) {
|
||||
|
@@ -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',
|
||||
});
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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';
|
||||
|
@@ -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';
|
||||
|
@@ -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 = () => {
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -12,6 +12,7 @@
|
||||
|
||||
const { proxy } = getCurrentInstance() as any;
|
||||
const { copy, copied } = useClipboard();
|
||||
const queryFormRef = ref();
|
||||
const systemLogList = ref<SystemLogRecord[]>([]);
|
||||
const systemLog = ref<SystemLogDetailRecord>({
|
||||
traceId: '',
|
||||
@@ -112,7 +113,7 @@
|
||||
* 重置
|
||||
*/
|
||||
const resetQuery = () => {
|
||||
proxy.$refs.queryRef.resetFields();
|
||||
queryFormRef.value.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
@@ -151,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>
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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) => {
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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) => {
|
||||
|
@@ -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>
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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>
|
||||
|
||||
|
@@ -57,7 +57,7 @@
|
||||
hideCancel: false,
|
||||
onOk: () => {
|
||||
socialAuth(source).then((res) => {
|
||||
window.location.href = res.data;
|
||||
window.location.href = res.data.authorizeUrl;
|
||||
});
|
||||
},
|
||||
});
|
||||
|
@@ -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,
|
||||
|
@@ -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,
|
||||
|
@@ -9,6 +9,7 @@
|
||||
|
||||
const { t } = useI18n();
|
||||
const userStore = useUserStore();
|
||||
const formRef = ref();
|
||||
const visible = ref(false);
|
||||
|
||||
// 表单数据
|
||||
@@ -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) || '',
|
||||
|
@@ -21,6 +21,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 total = ref(0);
|
||||
@@ -191,7 +194,7 @@
|
||||
form.value = {
|
||||
gender: 1,
|
||||
};
|
||||
proxy.$refs.formRef?.resetFields();
|
||||
formRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -201,7 +204,7 @@
|
||||
visible.value = false;
|
||||
resetPasswordVisible.value = false;
|
||||
userRoleVisible.value = false;
|
||||
proxy.$refs.formRef?.resetFields();
|
||||
formRef.value?.resetFields();
|
||||
proxy.$refs.resetPasswordFormRef?.resetFields();
|
||||
proxy.$refs.userRoleFormRef?.resetFields();
|
||||
};
|
||||
@@ -210,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) => {
|
||||
@@ -328,7 +331,7 @@
|
||||
del(ids).then((res) => {
|
||||
proxy.$message.success(res.msg);
|
||||
getList();
|
||||
proxy.$refs.tableRef.selectAll(false);
|
||||
tableRef.value.selectAll(false);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -424,7 +427,7 @@
|
||||
* 重置
|
||||
*/
|
||||
const resetQuery = () => {
|
||||
proxy.$refs.queryRef.resetFields();
|
||||
queryFormRef.value.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
@@ -487,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"
|
||||
|
@@ -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%"
|
||||
|
Reference in New Issue
Block a user