优化代码

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: "通知标题", label: "通知标题",
prop: "title", prop: "title",
row: true, row: true,
search: true search: true,
rules: [{
required: true,
message: "请输入通知标题",
trigger: "blur"
}]
}, },
{ {
label: "通知类型", label: "通知类型",
@ -68,7 +73,24 @@
}, },
slot: true, slot: true,
prop: "category", 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: "通知内容", label: "通知内容",
@ -76,13 +98,6 @@
span: 24, span: 24,
minRows: 6, minRows: 6,
type: "textarea" 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, span: 24,
minRows: 2, minRows: 2,
hide: true hide: true
},
{
label: "日志数据",
prop: "stackTrace",
type: "textarea",
span: 24,
minRows: 6,
hide: true
} }
] ]
}, },

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -55,6 +55,23 @@
export default { export default {
data() { 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 { return {
form: {}, form: {},
selectionList: [], selectionList: [],
@ -69,20 +86,49 @@
index: true, index: true,
selection: true, selection: true,
viewBtn: true, viewBtn: true,
calcHeight:800,
column: [ column: [
{ {
label: "登录账号", label: "登录账号",
prop: "account", 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: "用户昵称", label: "用户昵称",
prop: "name", prop: "name",
search: true search: true,
rules: [{
required: true,
message: "请输入用户昵称",
trigger: "blur"
}]
}, },
{ {
label: "用户姓名", label: "用户姓名",
prop: "realName" prop: "realName",
rules: [{
required: true,
message: "请输入用户姓名",
trigger: "blur"
}]
}, },
{ {
label: "所属角色", label: "所属角色",
@ -93,7 +139,12 @@
props: { props: {
label: "title" label: "title"
}, },
slot: true slot: true,
rules: [{
required: true,
message: "请选择所属角色",
trigger: "blur"
}]
}, },
{ {
label: "所属部门", label: "所属部门",
@ -104,7 +155,12 @@
props: { props: {
label: "title" label: "title"
}, },
slot: true slot: true,
rules: [{
required: true,
message: "请选择所属部门",
trigger: "blur"
}]
}, },
{ {
label: "手机号码", label: "手机号码",
@ -116,6 +172,33 @@
prop: "email", prop: "email",
overHidden: true 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: "账号状态", label: "账号状态",
prop: "statusName", prop: "statusName",

View File

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