refactor: 前端表单重置优化
This commit is contained in:
commit
e947312f24
16
CHANGELOG.md
16
CHANGELOG.md
@ -1,3 +1,19 @@
|
|||||||
|
## [v1.1.2](https://github.com/Charles7c/continew-admin/compare/v1.1.1...v1.1.2) (2023-09-24)
|
||||||
|
|
||||||
|
### 💎 功能优化
|
||||||
|
|
||||||
|
- 优化后端程序启动成功输出内容 ([6322859](https://github.com/Charles7c/continew-admin/commit/63228598d9fcd6e5d00172c12418a371d4c96766))
|
||||||
|
- 配置子级菜单图标 ([5544836](https://github.com/Charles7c/continew-admin/commit/55448364a39085debb776463f5e95a15b186c447))
|
||||||
|
|
||||||
|
### 🐛 问题修复
|
||||||
|
|
||||||
|
- 修复生产环境和开发环境样式不一致的问题 ([be8732d](https://github.com/Charles7c/continew-admin/commit/be8732d812e021631864b0ff6225b4da24cafcee))
|
||||||
|
- 排除路径配置放开 /error ([0428fe7](https://github.com/Charles7c/continew-admin/commit/0428fe776224afb64601901cef4d3100e5d30bd6))
|
||||||
|
- 修复初始数据缺失字段列表的问题 ([d5138e1](https://github.com/Charles7c/continew-admin/commit/d5138e1e43bdc8b347e061890131ac2646b2dd3c))
|
||||||
|
- 修复系统日志表索引缺失导致查询耗时较长的问题 ([ac43833](https://github.com/Charles7c/continew-admin/commit/ac438337219f5a160d49b255805774da36ab865c))
|
||||||
|
- 修复部分菜单数据 component 信息配置错误 ([11ea072](https://github.com/Charles7c/continew-admin/commit/11ea072d600f24fe97fe8145208e821712b84839))
|
||||||
|
- 修复图标 SVG 内容格式错误 ([20f1e8a](https://github.com/Charles7c/continew-admin/commit/20f1e8aecc737b28ab869d363957513d868b4ab7))
|
||||||
|
|
||||||
## [v1.1.1](https://github.com/Charles7c/continew-admin/compare/v1.1.0...v1.1.1) (2023-09-06)
|
## [v1.1.1](https://github.com/Charles7c/continew-admin/compare/v1.1.0...v1.1.1) (2023-09-06)
|
||||||
|
|
||||||
### 💎 功能优化
|
### 💎 功能优化
|
||||||
|
@ -66,7 +66,7 @@ public class UserRequest extends BaseRequest {
|
|||||||
* 邮箱
|
* 邮箱
|
||||||
*/
|
*/
|
||||||
@Schema(description = "邮箱", example = "123456789@qq.com")
|
@Schema(description = "邮箱", example = "123456789@qq.com")
|
||||||
@Pattern(regexp = RegexConsts.EMAIL, message = "邮箱格式错误")
|
@Pattern(regexp = "^$|" + RegexConsts.EMAIL, message = "邮箱格式错误")
|
||||||
@Length(max = 255, message = "邮箱长度不能超过 {max} 个字符")
|
@Length(max = 255, message = "邮箱长度不能超过 {max} 个字符")
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ public class UserRequest extends BaseRequest {
|
|||||||
* 手机号码
|
* 手机号码
|
||||||
*/
|
*/
|
||||||
@Schema(description = "手机号码", example = "13811111111")
|
@Schema(description = "手机号码", example = "13811111111")
|
||||||
@Pattern(regexp = RegexConsts.MOBILE, message = "手机号码格式错误")
|
@Pattern(regexp = "^$|" + RegexConsts.MOBILE, message = "手机号码格式错误")
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -83,7 +83,7 @@ public class GenConfigDO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@Schema(description = "前端路径", example = "D:/continew-admin/continew-admin-ui/src/views/system/user")
|
@Schema(description = "前端路径", example = "D:/continew-admin/continew-admin-ui/src/views/system/user")
|
||||||
@Length(max = 255, message = "前端路径不能超过 {max} 个字符")
|
@Length(max = 255, message = "前端路径不能超过 {max} 个字符")
|
||||||
@Pattern(regexp = "^(?=.*src\\/views)(?!.*\\/views\\/?$).*", message = "前端路径配置错误")
|
@Pattern(regexp = "^$|^(?=.*src\\/views)(?!.*\\/views\\/?$).*", message = "前端路径配置错误")
|
||||||
private String frontendPath;
|
private String frontendPath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -5,10 +5,10 @@ const BASE_URL = '/system/dept';
|
|||||||
|
|
||||||
export interface DataRecord {
|
export interface DataRecord {
|
||||||
id?: number;
|
id?: number;
|
||||||
name: string;
|
name?: string;
|
||||||
parentId?: number;
|
parentId?: number;
|
||||||
description?: string;
|
description?: string;
|
||||||
sort: number;
|
sort?: number;
|
||||||
status?: number;
|
status?: number;
|
||||||
isSystem?: boolean;
|
isSystem?: boolean;
|
||||||
createUserString?: string;
|
createUserString?: string;
|
||||||
|
@ -5,11 +5,11 @@ const BASE_URL = '/system/dict/item';
|
|||||||
|
|
||||||
export interface DataRecord {
|
export interface DataRecord {
|
||||||
id?: number;
|
id?: number;
|
||||||
label: string;
|
label?: string;
|
||||||
value: string;
|
value?: string;
|
||||||
color?: string;
|
color?: string;
|
||||||
sort?: number;
|
sort?: number;
|
||||||
description: string;
|
description?: string;
|
||||||
dictId?: number;
|
dictId?: number;
|
||||||
createUser?: string;
|
createUser?: string;
|
||||||
createTime?: string;
|
createTime?: string;
|
||||||
|
@ -5,10 +5,10 @@ const BASE_URL = '/system/dict';
|
|||||||
|
|
||||||
export interface DataRecord {
|
export interface DataRecord {
|
||||||
id?: number;
|
id?: number;
|
||||||
name: string;
|
name?: string;
|
||||||
code: string;
|
code?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
isSystem: boolean;
|
isSystem?: boolean;
|
||||||
createUser?: string;
|
createUser?: string;
|
||||||
createTime?: string;
|
createTime?: string;
|
||||||
updateUser?: string;
|
updateUser?: string;
|
||||||
|
@ -5,18 +5,18 @@ const BASE_URL = '/system/menu';
|
|||||||
|
|
||||||
export interface DataRecord {
|
export interface DataRecord {
|
||||||
id?: number;
|
id?: number;
|
||||||
title: string;
|
title?: string;
|
||||||
parentId?: number;
|
parentId?: number;
|
||||||
type: number;
|
type?: number;
|
||||||
path?: string;
|
path?: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
component?: string;
|
component?: string;
|
||||||
icon?: string;
|
icon?: string;
|
||||||
isExternal: boolean;
|
isExternal?: boolean;
|
||||||
isCache: boolean;
|
isCache?: boolean;
|
||||||
isHidden: boolean;
|
isHidden?: boolean;
|
||||||
permission?: string;
|
permission?: string;
|
||||||
sort: number;
|
sort?: number;
|
||||||
status?: number;
|
status?: number;
|
||||||
createUserString?: string;
|
createUserString?: string;
|
||||||
createTime?: string;
|
createTime?: string;
|
||||||
|
@ -5,12 +5,12 @@ const BASE_URL = '/system/role';
|
|||||||
|
|
||||||
export interface DataRecord {
|
export interface DataRecord {
|
||||||
id?: number;
|
id?: number;
|
||||||
name: string;
|
name?: string;
|
||||||
code?: string;
|
code?: string;
|
||||||
sort?: number;
|
sort?: number;
|
||||||
description?: string;
|
description?: string;
|
||||||
menuIds?: Array<number>;
|
menuIds?: Array<number>;
|
||||||
dataScope: number;
|
dataScope?: number;
|
||||||
deptIds?: Array<number>;
|
deptIds?: Array<number>;
|
||||||
status?: number;
|
status?: number;
|
||||||
isSystem?: boolean;
|
isSystem?: boolean;
|
||||||
|
@ -5,9 +5,9 @@ const BASE_URL = '/system/user';
|
|||||||
|
|
||||||
export interface DataRecord {
|
export interface DataRecord {
|
||||||
id?: number;
|
id?: number;
|
||||||
username: string;
|
username?: string;
|
||||||
nickname: string;
|
nickname?: string;
|
||||||
gender: number;
|
gender?: number;
|
||||||
email?: string;
|
email?: string;
|
||||||
phone?: string;
|
phone?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
|
@ -359,9 +359,7 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
const dataList = ref<DataRecord[]>([]);
|
const dataList = ref<DataRecord[]>([]);
|
||||||
const dataDetail = ref<DataRecord>({
|
const dataDetail = ref<DataRecord>({});
|
||||||
// TODO 待补充详情字段默认值
|
|
||||||
});
|
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const ids = ref<Array<number>>([]);
|
const ids = ref<Array<number>>([]);
|
||||||
const title = ref('');
|
const title = ref('');
|
||||||
@ -440,9 +438,7 @@
|
|||||||
* 重置表单
|
* 重置表单
|
||||||
*/
|
*/
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
form.value = {
|
form.value = {};
|
||||||
// TODO 待补充需要重置的字段默认值,详情请参考其他模块 index.vue
|
|
||||||
};
|
|
||||||
proxy.$refs.formRef?.resetFields();
|
proxy.$refs.formRef?.resetFields();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -321,17 +321,7 @@
|
|||||||
const { dis_enable_status_enum } = proxy.useDict('dis_enable_status_enum');
|
const { dis_enable_status_enum } = proxy.useDict('dis_enable_status_enum');
|
||||||
|
|
||||||
const dataList = ref<DataRecord[]>([]);
|
const dataList = ref<DataRecord[]>([]);
|
||||||
const dataDetail = ref<DataRecord>({
|
const dataDetail = ref<DataRecord>({});
|
||||||
name: '',
|
|
||||||
sort: 0,
|
|
||||||
description: '',
|
|
||||||
status: 1,
|
|
||||||
createUserString: '',
|
|
||||||
createTime: '',
|
|
||||||
updateUserString: '',
|
|
||||||
updateTime: '',
|
|
||||||
parentName: '',
|
|
||||||
});
|
|
||||||
const ids = ref<Array<number>>([]);
|
const ids = ref<Array<number>>([]);
|
||||||
const title = ref('');
|
const title = ref('');
|
||||||
const single = ref(true);
|
const single = ref(true);
|
||||||
@ -423,13 +413,7 @@
|
|||||||
*/
|
*/
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
form.value = {
|
form.value = {
|
||||||
id: undefined,
|
|
||||||
name: '',
|
|
||||||
parentId: undefined,
|
|
||||||
description: '',
|
|
||||||
sort: 999,
|
sort: 999,
|
||||||
status: 1,
|
|
||||||
disabled: false,
|
|
||||||
};
|
};
|
||||||
proxy.$refs.formRef?.resetFields();
|
proxy.$refs.formRef?.resetFields();
|
||||||
};
|
};
|
||||||
|
@ -351,13 +351,7 @@
|
|||||||
* 重置表单
|
* 重置表单
|
||||||
*/
|
*/
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
form.value = {
|
form.value = {};
|
||||||
id: undefined,
|
|
||||||
name: '',
|
|
||||||
code: '',
|
|
||||||
description: '',
|
|
||||||
isSystem: false,
|
|
||||||
};
|
|
||||||
proxy.$refs.formRef?.resetFields();
|
proxy.$refs.formRef?.resetFields();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -262,12 +262,8 @@
|
|||||||
*/
|
*/
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
form.value = {
|
form.value = {
|
||||||
id: undefined,
|
|
||||||
label: '',
|
|
||||||
value: '',
|
|
||||||
color: '#165DFF',
|
color: '#165DFF',
|
||||||
sort: 999,
|
sort: 999,
|
||||||
description: '',
|
|
||||||
dictId: dictId.value,
|
dictId: dictId.value,
|
||||||
};
|
};
|
||||||
proxy.$refs.formRef?.resetFields();
|
proxy.$refs.formRef?.resetFields();
|
||||||
|
@ -448,20 +448,11 @@
|
|||||||
*/
|
*/
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
form.value = {
|
form.value = {
|
||||||
id: undefined,
|
|
||||||
title: '',
|
|
||||||
parentId: undefined,
|
|
||||||
type: 1,
|
type: 1,
|
||||||
path: undefined,
|
|
||||||
name: undefined,
|
|
||||||
component: undefined,
|
|
||||||
icon: undefined,
|
|
||||||
isExternal: false,
|
isExternal: false,
|
||||||
isCache: false,
|
isCache: false,
|
||||||
isHidden: false,
|
isHidden: false,
|
||||||
permission: undefined,
|
|
||||||
sort: 999,
|
sort: 999,
|
||||||
status: 1,
|
|
||||||
};
|
};
|
||||||
proxy.$refs.formRef?.resetFields();
|
proxy.$refs.formRef?.resetFields();
|
||||||
};
|
};
|
||||||
|
@ -443,19 +443,7 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
const dataList = ref<DataRecord[]>([]);
|
const dataList = ref<DataRecord[]>([]);
|
||||||
const dataDetail = ref<DataRecord>({
|
const dataDetail = ref<DataRecord>({});
|
||||||
name: '',
|
|
||||||
code: '',
|
|
||||||
status: 1,
|
|
||||||
dataScope: 1,
|
|
||||||
createUserString: '',
|
|
||||||
createTime: '',
|
|
||||||
updateUserString: '',
|
|
||||||
updateTime: '',
|
|
||||||
description: '',
|
|
||||||
menuIds: undefined,
|
|
||||||
deptIds: undefined,
|
|
||||||
});
|
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const ids = ref<Array<number>>([]);
|
const ids = ref<Array<number>>([]);
|
||||||
const title = ref('');
|
const title = ref('');
|
||||||
@ -603,16 +591,8 @@
|
|||||||
proxy.$refs.menuRef?.expandAll(menuExpandAll.value);
|
proxy.$refs.menuRef?.expandAll(menuExpandAll.value);
|
||||||
proxy.$refs.deptRef?.expandAll(deptExpandAll.value);
|
proxy.$refs.deptRef?.expandAll(deptExpandAll.value);
|
||||||
form.value = {
|
form.value = {
|
||||||
id: undefined,
|
|
||||||
name: '',
|
|
||||||
code: undefined,
|
|
||||||
dataScope: 4,
|
dataScope: 4,
|
||||||
description: '',
|
|
||||||
sort: 999,
|
sort: 999,
|
||||||
status: 1,
|
|
||||||
menuIds: [],
|
|
||||||
deptIds: [],
|
|
||||||
disabled: false,
|
|
||||||
};
|
};
|
||||||
proxy.$refs.formRef?.resetFields();
|
proxy.$refs.formRef?.resetFields();
|
||||||
};
|
};
|
||||||
|
@ -532,22 +532,7 @@
|
|||||||
const { dis_enable_status_enum } = proxy.useDict('dis_enable_status_enum');
|
const { dis_enable_status_enum } = proxy.useDict('dis_enable_status_enum');
|
||||||
|
|
||||||
const dataList = ref<DataRecord[]>([]);
|
const dataList = ref<DataRecord[]>([]);
|
||||||
const dataDetail = ref<DataRecord>({
|
const dataDetail = ref<DataRecord>({});
|
||||||
username: '',
|
|
||||||
nickname: '',
|
|
||||||
gender: 1,
|
|
||||||
phone: undefined,
|
|
||||||
email: undefined,
|
|
||||||
status: 1,
|
|
||||||
pwdResetTime: '',
|
|
||||||
createUserString: '',
|
|
||||||
createTime: '',
|
|
||||||
updateUserString: '',
|
|
||||||
updateTime: '',
|
|
||||||
description: '',
|
|
||||||
roleIds: undefined,
|
|
||||||
deptId: undefined,
|
|
||||||
});
|
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const ids = ref<Array<number>>([]);
|
const ids = ref<Array<number>>([]);
|
||||||
const title = ref('');
|
const title = ref('');
|
||||||
@ -700,17 +685,7 @@
|
|||||||
*/
|
*/
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
form.value = {
|
form.value = {
|
||||||
id: undefined,
|
|
||||||
username: '',
|
|
||||||
nickname: '',
|
|
||||||
gender: 1,
|
gender: 1,
|
||||||
email: undefined,
|
|
||||||
phone: undefined,
|
|
||||||
description: '',
|
|
||||||
status: 1,
|
|
||||||
deptId: undefined,
|
|
||||||
roleIds: [] as Array<number>,
|
|
||||||
disabled: false,
|
|
||||||
};
|
};
|
||||||
proxy.$refs.formRef?.resetFields();
|
proxy.$refs.formRef?.resetFields();
|
||||||
};
|
};
|
||||||
|
@ -82,7 +82,7 @@ CREATE TABLE IF NOT EXISTS `sys_role_dept` (
|
|||||||
CREATE TABLE IF NOT EXISTS `sys_user` (
|
CREATE TABLE IF NOT EXISTS `sys_user` (
|
||||||
`id` bigint(20) UNSIGNED AUTO_INCREMENT COMMENT 'ID',
|
`id` bigint(20) UNSIGNED AUTO_INCREMENT COMMENT 'ID',
|
||||||
`username` varchar(64) NOT NULL COMMENT '用户名',
|
`username` varchar(64) NOT NULL COMMENT '用户名',
|
||||||
`nickname` varchar(30) DEFAULT NULL COMMENT '昵称',
|
`nickname` varchar(30) NOT NULL COMMENT '昵称',
|
||||||
`password` varchar(32) DEFAULT NULL COMMENT '密码',
|
`password` varchar(32) DEFAULT NULL COMMENT '密码',
|
||||||
`gender` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '性别(0:未知,1:男,2:女)',
|
`gender` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '性别(0:未知,1:男,2:女)',
|
||||||
`email` varchar(255) DEFAULT NULL COMMENT '邮箱',
|
`email` varchar(255) DEFAULT NULL COMMENT '邮箱',
|
||||||
|
Loading…
Reference in New Issue
Block a user