diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/JIAL/FMSystem/controller/EmployeeController.java b/src/main/java/com/JIAL/FMSystem/controller/EmployeeController.java index c583ccb..fb3760a 100644 --- a/src/main/java/com/JIAL/FMSystem/controller/EmployeeController.java +++ b/src/main/java/com/JIAL/FMSystem/controller/EmployeeController.java @@ -82,7 +82,6 @@ public class EmployeeController { //设置初始密码123456,需要进行md5加密处理 employee.setPassword(DigestUtils.md5DigestAsHex(employee.getPassword().getBytes())); - employee.setIdNumber("64222420001025301X"); //employee.setCreateTime(LocalDateTime.now()); //employee.setUpdateTime(LocalDateTime.now()); @@ -101,12 +100,12 @@ public class EmployeeController { * 员工信息分页查询 * @param page * @param pageSize - * @param name + * @param username * @return */ @GetMapping("/page") - public R page(int page,int pageSize,String name){ - log.info("page = {},pageSize = {},name = {}" ,page,pageSize,name); + public R page(int page,int pageSize,String username){ + log.info("page = {},pageSize = {},username = {}" ,page,pageSize,username); //构造分页构造器 Page pageInfo = new Page(page,pageSize); @@ -114,7 +113,7 @@ public class EmployeeController { //构造条件构造器 LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); //添加过滤条件 - queryWrapper.like(StringUtils.isNotEmpty(name),Employee::getName,name); + queryWrapper.like(StringUtils.isNotEmpty(username),Employee::getUsername,username); //添加排序条件 queryWrapper.orderByDesc(Employee::getUpdateTime); diff --git a/src/main/java/com/JIAL/FMSystem/entity/Employee.java b/src/main/java/com/JIAL/FMSystem/entity/Employee.java index b0e30bf..6b8d6d9 100644 --- a/src/main/java/com/JIAL/FMSystem/entity/Employee.java +++ b/src/main/java/com/JIAL/FMSystem/entity/Employee.java @@ -24,9 +24,7 @@ public class Employee implements Serializable { private String phone; - private String sex; - - private String idNumber;//身份证号码 + private String admin; private Integer status; diff --git a/src/main/resources/backend/index.html b/src/main/resources/backend/index.html index f01d574..55c0d62 100644 --- a/src/main/resources/backend/index.html +++ b/src/main/resources/backend/index.html @@ -4,7 +4,7 @@ - 瑞吉外卖管理端 + 法务管理系统 @@ -117,46 +117,9 @@ defAct: '2', menuActived: '2', userInfo: {}, - menuList: [ - // { - // id: '1', - // name: '门店管理', - // children: [ - { - id: '2', - name: '账号管理', - url: 'page/member/list.html', - icon: 'icon-member' - }, - { - id: '3', - name: '全部案件', - url: 'page/category/list.html', - icon: 'icon-category' - }, - { - id: '4', - name: '合同纠纷', - url: 'page/food/list.html', - icon: 'icon-food' - }, - { - id: '5', - name: '出资纠纷', - url: 'page/combo/list.html', - icon: 'icon-combo' - }, - { - id: '6', - name: '行政纠纷', - url: 'page/order/list.html', - icon: 'icon-order' - } - // ], - // }, - ], + menuList: [], iframeUrl: 'page/member/list.html', - headTitle: '员工管理', + headTitle: '全部案件', goBackFlag: false, loading: true, timer: null @@ -168,6 +131,8 @@ if (userInfo) { this.userInfo = JSON.parse(userInfo) } + this.menuList = this.generateMenuList(); + this.menuHandle(this.menuList.find(item => item.id === this.defAct), false); // 手动调用一次 menuHandle this.closeLoading() }, beforeDestroy() { @@ -178,6 +143,48 @@ window.menuHandle = this.menuHandle }, methods: { + generateMenuList() { + const userInfo = JSON.parse(window.localStorage.getItem('userInfo')); + const isAdmin = userInfo && userInfo.admin === "0"; + + const baseMenuList = [ + { + id: '2', + name: '全部案件', + url: 'page/category/list.html', + icon: 'icon-category' + }, + { + id: '3', + name: '合同纠纷', + url: 'page/food/list.html', + icon: 'icon-food' + }, + { + id: '4', + name: '出资纠纷', + url: 'page/combo/list.html', + icon: 'icon-combo' + }, + { + id: '5', + name: '行政纠纷', + url: 'page/order/list.html', + icon: 'icon-order' + }, + ]; + + // 添加账号管理菜单项仅当用户是管理员时 + if (!isAdmin) { + baseMenuList.push({ + id: '6', + name: '账号管理', + url: 'page/member/list.html', + icon: 'icon-member' + }); + } + return baseMenuList; + }, logout() { logoutApi().then((res)=>{ if(res.code === 1){ diff --git a/src/main/resources/backend/js/validate.js b/src/main/resources/backend/js/validate.js index 2891cff..1c18d01 100644 --- a/src/main/resources/backend/js/validate.js +++ b/src/main/resources/backend/js/validate.js @@ -50,13 +50,13 @@ function checkPhone (rule, value, callback){ function checkPassword (rule,value,callback) { - // 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X + // 密码为1到32位的数字字母组合 let reg = /^[a-zA-Z0-9]{1,32}$/ if(value == '') { - callback(new Error('请输入身份证号码')) + callback(new Error('请输入密码')) } else if (reg.test(value)) { callback() } else { - callback(new Error('身份证号码不正确')) + callback(new Error('密码格式不正确,请输入1-32位的数字密码组合')) } } \ No newline at end of file diff --git a/src/main/resources/backend/page/member/add.html b/src/main/resources/backend/page/member/add.html index 744aa97..a944a63 100644 --- a/src/main/resources/backend/page/member/add.html +++ b/src/main/resources/backend/page/member/add.html @@ -46,12 +46,12 @@ /> - - - + + + { - console.log(res) if (String(res.code) === '1') { console.log(res.data) this.ruleForm = res.data - this.ruleForm.sex = res.data.sex === '0' ? '女' : '男' + this.ruleForm.admin = res.data.admin === '0' ? '否' : '是' // this.ruleForm.password = '' } else { this.$message.error(res.msg || '操作失败') @@ -159,10 +158,11 @@ if (this.actionType === 'add') { const params = { ...this.ruleForm, - sex: this.ruleForm.sex === '女' ? '0' : '1' + admin: this.ruleForm.admin === '否' ? '0' : '1' } addEmployee(params).then(res => { if (res.code === 1) { + console.log("添加成功") this.$message.success('员工添加成功!') if (!st) { this.goBack() @@ -173,7 +173,7 @@ 'phone': '', // 'password': '', // 'rePassword': '',/ - 'sex': '男', + 'admin': '是', 'password': '' } } @@ -186,11 +186,14 @@ } else { const params = { ...this.ruleForm, - sex: this.ruleForm.sex === '女' ? '0' : '1' + admin: this.ruleForm.admin === '否' ? '0' : '1' } editEmployee(params).then(res => { + console.log(res.toString()); if (res.code === 1) { - this.$message.success('员工信息修改成功!') + var vm = this; + Vue.prototype.$message.success('员工信息修改成功!') + console.log("修改成功"); this.goBack() } else { this.$message.error(res.msg || '操作失败') diff --git a/src/main/resources/backend/page/member/list.html b/src/main/resources/backend/page/member/list.html index 17f8031..e98222e 100644 --- a/src/main/resources/backend/page/member/list.html +++ b/src/main/resources/backend/page/member/list.html @@ -22,7 +22,7 @@
{ if (String(res.code) === '1') { diff --git a/target/classes/backend/index.html b/target/classes/backend/index.html index f01d574..55c0d62 100644 --- a/target/classes/backend/index.html +++ b/target/classes/backend/index.html @@ -4,7 +4,7 @@ - 瑞吉外卖管理端 + 法务管理系统 @@ -117,46 +117,9 @@ defAct: '2', menuActived: '2', userInfo: {}, - menuList: [ - // { - // id: '1', - // name: '门店管理', - // children: [ - { - id: '2', - name: '账号管理', - url: 'page/member/list.html', - icon: 'icon-member' - }, - { - id: '3', - name: '全部案件', - url: 'page/category/list.html', - icon: 'icon-category' - }, - { - id: '4', - name: '合同纠纷', - url: 'page/food/list.html', - icon: 'icon-food' - }, - { - id: '5', - name: '出资纠纷', - url: 'page/combo/list.html', - icon: 'icon-combo' - }, - { - id: '6', - name: '行政纠纷', - url: 'page/order/list.html', - icon: 'icon-order' - } - // ], - // }, - ], + menuList: [], iframeUrl: 'page/member/list.html', - headTitle: '员工管理', + headTitle: '全部案件', goBackFlag: false, loading: true, timer: null @@ -168,6 +131,8 @@ if (userInfo) { this.userInfo = JSON.parse(userInfo) } + this.menuList = this.generateMenuList(); + this.menuHandle(this.menuList.find(item => item.id === this.defAct), false); // 手动调用一次 menuHandle this.closeLoading() }, beforeDestroy() { @@ -178,6 +143,48 @@ window.menuHandle = this.menuHandle }, methods: { + generateMenuList() { + const userInfo = JSON.parse(window.localStorage.getItem('userInfo')); + const isAdmin = userInfo && userInfo.admin === "0"; + + const baseMenuList = [ + { + id: '2', + name: '全部案件', + url: 'page/category/list.html', + icon: 'icon-category' + }, + { + id: '3', + name: '合同纠纷', + url: 'page/food/list.html', + icon: 'icon-food' + }, + { + id: '4', + name: '出资纠纷', + url: 'page/combo/list.html', + icon: 'icon-combo' + }, + { + id: '5', + name: '行政纠纷', + url: 'page/order/list.html', + icon: 'icon-order' + }, + ]; + + // 添加账号管理菜单项仅当用户是管理员时 + if (!isAdmin) { + baseMenuList.push({ + id: '6', + name: '账号管理', + url: 'page/member/list.html', + icon: 'icon-member' + }); + } + return baseMenuList; + }, logout() { logoutApi().then((res)=>{ if(res.code === 1){ diff --git a/target/classes/backend/js/validate.js b/target/classes/backend/js/validate.js index 2891cff..1c18d01 100644 --- a/target/classes/backend/js/validate.js +++ b/target/classes/backend/js/validate.js @@ -50,13 +50,13 @@ function checkPhone (rule, value, callback){ function checkPassword (rule,value,callback) { - // 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X + // 密码为1到32位的数字字母组合 let reg = /^[a-zA-Z0-9]{1,32}$/ if(value == '') { - callback(new Error('请输入身份证号码')) + callback(new Error('请输入密码')) } else if (reg.test(value)) { callback() } else { - callback(new Error('身份证号码不正确')) + callback(new Error('密码格式不正确,请输入1-32位的数字密码组合')) } } \ No newline at end of file diff --git a/target/classes/backend/page/member/add.html b/target/classes/backend/page/member/add.html index 744aa97..a944a63 100644 --- a/target/classes/backend/page/member/add.html +++ b/target/classes/backend/page/member/add.html @@ -46,12 +46,12 @@ /> - - - + + + { - console.log(res) if (String(res.code) === '1') { console.log(res.data) this.ruleForm = res.data - this.ruleForm.sex = res.data.sex === '0' ? '女' : '男' + this.ruleForm.admin = res.data.admin === '0' ? '否' : '是' // this.ruleForm.password = '' } else { this.$message.error(res.msg || '操作失败') @@ -159,10 +158,11 @@ if (this.actionType === 'add') { const params = { ...this.ruleForm, - sex: this.ruleForm.sex === '女' ? '0' : '1' + admin: this.ruleForm.admin === '否' ? '0' : '1' } addEmployee(params).then(res => { if (res.code === 1) { + console.log("添加成功") this.$message.success('员工添加成功!') if (!st) { this.goBack() @@ -173,7 +173,7 @@ 'phone': '', // 'password': '', // 'rePassword': '',/ - 'sex': '男', + 'admin': '是', 'password': '' } } @@ -186,11 +186,14 @@ } else { const params = { ...this.ruleForm, - sex: this.ruleForm.sex === '女' ? '0' : '1' + admin: this.ruleForm.admin === '否' ? '0' : '1' } editEmployee(params).then(res => { + console.log(res.toString()); if (res.code === 1) { - this.$message.success('员工信息修改成功!') + var vm = this; + Vue.prototype.$message.success('员工信息修改成功!') + console.log("修改成功"); this.goBack() } else { this.$message.error(res.msg || '操作失败') diff --git a/target/classes/backend/page/member/list.html b/target/classes/backend/page/member/list.html index 17f8031..e98222e 100644 --- a/target/classes/backend/page/member/list.html +++ b/target/classes/backend/page/member/list.html @@ -22,7 +22,7 @@
{ if (String(res.code) === '1') { diff --git a/target/classes/com/JIAL/FMSystem/FWApplication.class b/target/classes/com/JIAL/FMSystem/FWApplication.class new file mode 100644 index 0000000..349b274 Binary files /dev/null and b/target/classes/com/JIAL/FMSystem/FWApplication.class differ diff --git a/target/classes/com/JIAL/FMSystem/controller/EmployeeController.class b/target/classes/com/JIAL/FMSystem/controller/EmployeeController.class index be3d287..9b6cddf 100644 Binary files a/target/classes/com/JIAL/FMSystem/controller/EmployeeController.class and b/target/classes/com/JIAL/FMSystem/controller/EmployeeController.class differ diff --git a/target/classes/com/JIAL/FMSystem/entity/Employee.class b/target/classes/com/JIAL/FMSystem/entity/Employee.class index 7a1a01e..fcc3833 100644 Binary files a/target/classes/com/JIAL/FMSystem/entity/Employee.class and b/target/classes/com/JIAL/FMSystem/entity/Employee.class differ