diff --git a/src/api/select.js b/src/api/select.js index e8f6ee3..6b50615 100644 --- a/src/api/select.js +++ b/src/api/select.js @@ -16,4 +16,13 @@ export async function getDeptSelectApi(params) { method: 'get', params, }) +} + +// 角色下拉选 +export async function getRoleSelectApi(params) { + return await request({ + url: '/smartArchives/system/role/select', + method: 'get', + params, + }) } \ No newline at end of file diff --git a/src/api/system/user.js b/src/api/system/user.js index 9abf556..f0c6ed8 100644 --- a/src/api/system/user.js +++ b/src/api/system/user.js @@ -31,7 +31,7 @@ export function addUser(data) { export function updateUser(data) { return request({ url: '/smartArchives/system/user', - method: 'put', + method: 'POST', data: data }) } diff --git a/src/utils/validate.js b/src/utils/validate.js index fc49f90..e1f3a9f 100644 --- a/src/utils/validate.js +++ b/src/utils/validate.js @@ -100,10 +100,22 @@ export function validAlphabets(str) { */ export function validEmail(email) { const reg = - /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ + /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@(([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ return reg.test(email) } +/** + * 中国大陆手机号校验 + * 规则:可选国家码(+86/0086/86),以 1 开头的 11 位号码,号段 1[3-9] + * @param {string|number} mobile + * @returns {Boolean} + */ +export function validMobile(mobile) { + const value = String(mobile || '').trim() + const reg = /^(?:(?:\+|00)?86)?1[3-9]\d{9}$/ + return reg.test(value) +} + /** * @param {string} str * @returns {Boolean} diff --git a/src/views/system/user/config.js b/src/views/system/user/config.js new file mode 100644 index 0000000..fdd5515 --- /dev/null +++ b/src/views/system/user/config.js @@ -0,0 +1,31 @@ +export const formLabel = [ + { + isShow: false, // 是否展示label + f_type: 'ipt', + f_label: '用户名', + f_model: 'nickName', + f_max: 32, + }, + { + isShow: false, // 是否展示label + f_type: 'ipt', + f_label: '手机号', + f_model: 'phonenumber', + f_max: 32, + }, + { + isShow: false, // 是否展示label + f_type: 'sel', + f_label: '角色', + f_model: 'roleId', + f_selList: [], + }, +] + +export const columnsList = [ + { t_props: 'userName', t_label: '用户账号' }, + { t_props: 'nickName', t_label: '用户姓名' }, + { t_props: 'phonenumberDes', t_label: '手机号' }, + { t_slot: 'deptName', t_label: '组织部门' }, + { t_slot: 'roleName', t_label: '角色' }, +] \ No newline at end of file diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index e3f3922..bc8d058 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -1,764 +1,168 @@ + - - - - - - - + + + - - - - - - - - - - - - - - - - - - 查询 - - - 重置 - - - - - - - 新增 - - - - - - - - - - - - - - - - - - - 修改 - - - 删除 - - - - 重置密码 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 将文件拖到此处,或点击上传 - - - 是否更新已经存在的用户数据 - - 仅允许导入xls、xlsx格式文件。 - 下载模板 - - - - + + + + + 新增 + + + + {{ data.dept.deptName || '--' }} + + + {{ data.roles[0].roleName || '--'}} + + + + 修改 + + + 删除 + + + 重置密码 + + + + + diff --git a/src/views/system/user/index_old2.vue b/src/views/system/user/index_old2.vue new file mode 100644 index 0000000..e3f3922 --- /dev/null +++ b/src/views/system/user/index_old2.vue @@ -0,0 +1,764 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + 查询 + + + 重置 + + + + + + + 新增 + + + + + + + + + + + + + + + + + + + 修改 + + + 删除 + + + + 重置密码 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 将文件拖到此处,或点击上传 + + + 是否更新已经存在的用户数据 + + 仅允许导入xls、xlsx格式文件。 + 下载模板 + + + + + + + + diff --git a/src/views/system/user/profile/userForm.vue b/src/views/system/user/profile/userForm.vue new file mode 100644 index 0000000..c19d7db --- /dev/null +++ b/src/views/system/user/profile/userForm.vue @@ -0,0 +1,310 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 取消 + 确认 + + + + + + \ No newline at end of file