优化代码

This commit is contained in:
smallchill 2019-02-22 10:17:28 +08:00
parent 821f604b58
commit 6b28e749b3
10 changed files with 306 additions and 64 deletions

View File

@ -55,7 +55,12 @@
label: "通知标题",
prop: "title",
row: true,
search: true
search: true,
rules: [{
required: true,
message: "请输入通知标题",
trigger: "blur"
}]
},
{
label: "通知类型",
@ -68,7 +73,24 @@
},
slot: true,
prop: "category",
search: true
search: true,
rules: [{
required: true,
message: "请输入通知类型",
trigger: "blur"
}]
},
{
label: "通知日期",
type: "date",
prop: "date",
format: "yyyy-MM-dd hh:mm:ss",
valueFormat: "yyyy-MM-dd hh:mm:ss",
rules: [{
required: true,
message: "请输入通知日期",
trigger: "blur"
}]
},
{
label: "通知内容",
@ -76,13 +98,6 @@
span: 24,
minRows: 6,
type: "textarea"
},
{
label: "通知日期",
type: "date",
prop: "date",
format: "yyyy-MM-dd hh:mm:ss",
valueFormat: "yyyy-MM-dd hh:mm:ss"
}
]
},

View File

@ -93,14 +93,6 @@
span: 24,
minRows: 2,
hide: true
},
{
label: "日志数据",
prop: "stackTrace",
type: "textarea",
span: 24,
minRows: 6,
hide: true
}
]
},

View File

@ -93,14 +93,6 @@
span: 24,
minRows: 2,
hide: true
},
{
label: "日志数据",
prop: "stackTrace",
type: "textarea",
span: 24,
minRows: 6,
hide: true
}
]
},

View File

@ -66,12 +66,22 @@
{
label: "部门名称",
prop: "deptName",
search: true
search: true,
rules: [{
required: true,
message: "请输入部门名称",
trigger: "blur"
}]
},
{
label: "部门全称",
prop: "fullName",
search: true
search: true,
rules: [{
required: true,
message: "请输入部门全称",
trigger: "blur"
}]
},
{
label: "上级部门",
@ -81,13 +91,23 @@
hide: true,
props: {
label: "title"
}
},
rules: [{
required: true,
message: "请选择上级部门",
trigger: "blur"
}]
},
{
label: "排序",
prop: "sort",
type: "number"
type: "number",
rules: [{
required: true,
message: "请输入排序",
trigger: "blur"
}]
}
]
},

View File

@ -66,12 +66,22 @@
{
label: "字典名称",
prop: "dictValue",
search: true
search: true,
rules: [{
required: true,
message: "请输入字典名称",
trigger: "blur"
}]
},
{
label: "字典编号",
prop: "code",
search: true
search: true,
rules: [{
required: true,
message: "请输入字典编号",
trigger: "blur"
}]
},
{
label: "上级字典",
@ -81,17 +91,32 @@
hide: true,
props: {
label: "title"
}
},
rules: [{
required: true,
message: "请选择上级字典",
trigger: "blur"
}]
},
{
label: "字典键值",
prop: "dictKey",
type: "number"
type: "number",
rules: [{
required: true,
message: "请输入字典键值",
trigger: "blur"
}]
},
{
label: "排序",
label: "字典排序",
prop: "sort",
type: "number"
type: "number",
rules: [{
required: true,
message: "请输入字典排序",
trigger: "blur"
}]
}
]
},

View File

@ -60,20 +60,40 @@
{
label: "菜单名称",
prop: "name",
search: true
search: true,
rules: [{
required: true,
message: "请输入菜单名称",
trigger: "blur"
}]
},
{
label: "菜单编号",
prop: "code",
search: true
search: true,
rules: [{
required: true,
message: "请输入菜单编号",
trigger: "blur"
}]
},
{
label: "菜单别名",
prop: "alias"
prop: "alias",
rules: [{
required: true,
message: "请输入菜单别名",
trigger: "blur"
}]
},
{
label: "路由地址",
prop: "path"
prop: "path",
rules: [{
required: true,
message: "请输入路由地址",
trigger: "blur"
}]
},
{
@ -84,7 +104,12 @@
hide: true,
props: {
label: "title"
}
},
rules: [{
required: true,
message: "请选择上级菜单",
trigger: "blur"
}]
},
{
@ -101,12 +126,22 @@
value: 2
}
],
hide: true
hide: true,
rules: [{
required: true,
message: "请选择菜单类型",
trigger: "blur"
}]
},
{
label: "排序",
label: "菜单排序",
prop: "sort",
type: "number"
type: "number",
rules: [{
required: true,
message: "请输入菜单排序",
trigger: "blur"
}]
},
{
label: "按钮功能",
@ -126,7 +161,12 @@
value: 2
}
],
hide: true
hide: true,
rules: [{
required: true,
message: "请选择按钮功能",
trigger: "blur"
}]
},
{
label: "菜单备注",

View File

@ -57,16 +57,31 @@
{
label: "参数名称",
prop: "paramName",
search: true
search: true,
rules: [{
required: true,
message: "请输入参数名称",
trigger: "blur"
}]
},
{
label: "参数键名",
prop: "paramKey",
search: true
search: true,
rules: [{
required: true,
message: "请输入参数键名",
trigger: "blur"
}]
},
{
label: "参数键值",
prop: "paramValue"
prop: "paramValue",
rules: [{
required: true,
message: "请输入参数键值",
trigger: "blur"
}]
}
]
},

View File

@ -96,12 +96,22 @@
{
label: "角色名称",
prop: "roleName",
search: true
search: true,
rules: [{
required: true,
message: "请输入角色名称",
trigger: "blur"
}]
},
{
label: "角色别名",
prop: "roleAlias",
search: true
search: true,
rules: [{
required: true,
message: "请输入角色别名",
trigger: "blur"
}]
},
{
label: "上级角色",
@ -111,12 +121,22 @@
hide: true,
props: {
label: "title"
}
},
rules: [{
required: true,
message: "请选择上级角色",
trigger: "blur"
}]
},
{
label: "角色排序",
prop: "sort",
type: "number"
type: "number",
rules: [{
required: true,
message: "请输入角色排序",
trigger: "blur"
}]
}
]
},

View File

@ -55,6 +55,23 @@
export default {
data() {
const validatePass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入密码'));
} else {
callback();
}
};
const validatePass2 = (rule, value, callback) => {
debugger
if (value === '') {
callback(new Error('请再次输入密码'));
} else if (value !== this.form.password) {
callback(new Error('两次输入密码不一致!'));
} else {
callback();
}
};
return {
form: {},
selectionList: [],
@ -69,20 +86,49 @@
index: true,
selection: true,
viewBtn: true,
calcHeight:800,
column: [
{
label: "登录账号",
prop: "account",
search: true
span: 24,
search: true,
rules: [{
required: true,
message: "请输入登录账号",
trigger: "blur"
}]
},
{
label: '密码',
prop: 'password',
hide: true,
rules: [{validator: validatePass, trigger: 'blur'}]
},
{
label: '确认密码',
prop: 'password2',
hide: true,
rules: [{validator: validatePass2, trigger: 'blur'}]
},
{
label: "用户昵称",
prop: "name",
search: true
search: true,
rules: [{
required: true,
message: "请输入用户昵称",
trigger: "blur"
}]
},
{
label: "用户姓名",
prop: "realName"
prop: "realName",
rules: [{
required: true,
message: "请输入用户姓名",
trigger: "blur"
}]
},
{
label: "所属角色",
@ -93,7 +139,12 @@
props: {
label: "title"
},
slot: true
slot: true,
rules: [{
required: true,
message: "请选择所属角色",
trigger: "blur"
}]
},
{
label: "所属部门",
@ -104,7 +155,12 @@
props: {
label: "title"
},
slot: true
slot: true,
rules: [{
required: true,
message: "请选择所属部门",
trigger: "blur"
}]
},
{
label: "手机号码",
@ -116,6 +172,33 @@
prop: "email",
overHidden: true
},
{
label: "用户性别",
prop: "sex",
type: "select",
dicData: [
{
label: "男",
value: 1
},
{
label: "女",
value: 2
},
{
label: "未知",
value: 3
}
],
hide: true
},
{
label: "用户生日",
type: "date",
prop: "birthday",
format: "yyyy-MM-dd hh:mm:ss",
valueFormat: "yyyy-MM-dd hh:mm:ss"
},
{
label: "账号状态",
prop: "statusName",

View File

@ -65,41 +65,81 @@
{
label: "模块名",
prop: "codeName",
search: true
search: true,
rules: [{
required: true,
message: "请输入模块名",
trigger: "blur"
}]
},
{
label: "服务名",
prop: "serviceName",
search: true
search: true,
rules: [{
required: true,
message: "请输入服务名",
trigger: "blur"
}]
},
{
label: "表名",
prop: "tableName"
prop: "tableName",
rules: [{
required: true,
message: "请输入表名",
trigger: "blur"
}]
},
{
label: "表前缀",
prop: "tablePrefix"
prop: "tablePrefix",
rules: [{
required: true,
message: "请输入表前缀",
trigger: "blur"
}]
},
{
label: "主键名",
prop: "pkName"
prop: "pkName",
rules: [{
required: true,
message: "请输入主键名",
trigger: "blur"
}]
},
{
label: "包名",
prop: "packageName",
overHidden: true
overHidden: true,
rules: [{
required: true,
message: "请输入包名",
trigger: "blur"
}]
},
{
label: "后端生成路径",
prop: "apiPath",
span: 24,
hide: true
hide: true,
rules: [{
required: true,
message: "请输入后端生成路径",
trigger: "blur"
}]
},
{
label: "前端生成路径",
prop: "webPath",
span: 24,
hide: true
hide: true,
rules: [{
required: true,
message: "请输入前端生成路径",
trigger: "blur"
}]
}
]
},