diff --git a/snowy-admin-web/src/api/sys/userApi.js b/snowy-admin-web/src/api/sys/userApi.js index 72783100..cb710760 100644 --- a/snowy-admin-web/src/api/sys/userApi.js +++ b/snowy-admin-web/src/api/sys/userApi.js @@ -69,5 +69,43 @@ export default { // 给用户授权角色 grantRole(data) { return request('grantRole', data) + }, + // 获取用户拥有资源 + userOwnResource(data) { + return request('ownResource', data, 'get') + }, + // 给用户授权资源 + userGrantResource(data) { + return request('grantResource', data) + }, + // 获取用户拥有权限 + userOwnPermission(data) { + return request('ownPermission', data, 'get') + }, + // 给用户授权权限 + userGrantPermission(data) { + return request('grantPermission', data) + }, + // 下载用户导入模板 + userDownloadImportUserTemplate(data) { + return request('downloadImportUserTemplate', data, 'get', { + responseType: 'blob' + }) + }, + // 用户导入 + userImport(data) { + return request('import', data) + }, + // 用户导出 + userExport(data) { + return request('export', data, 'get', { + responseType: 'blob' + }) + }, + // 按模板导出用户个人信息 + userExportUserInfo(data) { + return request('exportUserInfo', data, 'get', { + responseType: 'blob' + }) } } diff --git a/snowy-admin-web/src/locales/lang/en.js b/snowy-admin-web/src/locales/lang/en.js index 7e7e22da..c7a4d297 100644 --- a/snowy-admin-web/src/locales/lang/en.js +++ b/snowy-admin-web/src/locales/lang/en.js @@ -16,7 +16,10 @@ export default { editButton: 'edit', removeButton: 'delete', batchRemoveButton: 'batch Remove', - detailButton: 'detail' + detailButton: 'detail', + searchKey: 'Search Key', + imports: 'import', + more: 'More' }, model: { user: 'user', @@ -50,5 +53,10 @@ export default { emailCodePlaceholder: 'Please input a Email code', restPhoneType: 'For phone rest', restEmailType: 'For email rest' + }, + user: { + userStatus: 'User Status', + resetPassword: 'Reset Password', + role: 'Role', } } diff --git a/snowy-admin-web/src/locales/lang/zh-cn.js b/snowy-admin-web/src/locales/lang/zh-cn.js index e0f7fa38..3ddfa113 100644 --- a/snowy-admin-web/src/locales/lang/zh-cn.js +++ b/snowy-admin-web/src/locales/lang/zh-cn.js @@ -18,7 +18,10 @@ export default { editButton: '编辑', removeButton: '删除', batchRemoveButton: '批量删除', - detailButton: '详情' + detailButton: '详情', + searchKey: '关键词', + imports: '导入', + more: '更多', }, model: { user: '用户', @@ -52,5 +55,10 @@ export default { emailCodePlaceholder: '请输入邮件验证码', restPhoneType: '手机号找回', restEmailType: '邮箱找回' + }, + user: { + userStatus: '用户状态', + resetPassword: '重置密码', + role: '角色', } } diff --git a/snowy-admin-web/src/views/sys/position/form.vue b/snowy-admin-web/src/views/sys/position/form.vue index 301df2cc..addfade2 100644 --- a/snowy-admin-web/src/views/sys/position/form.vue +++ b/snowy-admin-web/src/views/sys/position/form.vue @@ -109,16 +109,14 @@ }) // 验证并提交数据 const onSubmit = () => { - formRef.value - .validate() - .then(() => { - submitLoading.value = true - positionApi.submitForm(formData.value, !formData.value.id).then(() => { - visible = false - submitLoading.value = false - emit('successful') - }) + formRef.value.validate().then(() => { + submitLoading.value = true + positionApi.submitForm(formData.value, !formData.value.id).then(() => { + visible = false + submitLoading.value = false + emit('successful') }) + }) } // 调用这个函数将子组件的一些数据和方法暴露出去 defineExpose({ diff --git a/snowy-admin-web/src/views/sys/resource/button/form.vue b/snowy-admin-web/src/views/sys/resource/button/form.vue index 8ffab37d..a27f949f 100644 --- a/snowy-admin-web/src/views/sys/resource/button/form.vue +++ b/snowy-admin-web/src/views/sys/resource/button/form.vue @@ -57,20 +57,18 @@ // 验证并提交数据 const onSubmit = () => { - formRef.value - .validate() - .then(() => { - const defParam = { - category: 'BUTTON', - // module: recordData.value.module, - parentId: recordData.value.id - } - const param = Object.assign(defParam, formData.value) - buttonApi.submitForm(param, !formData.value.id).then((res) => { - onClose() - emit('successful') - }) + formRef.value.validate().then(() => { + const defParam = { + category: 'BUTTON', + // module: recordData.value.module, + parentId: recordData.value.id + } + const param = Object.assign(defParam, formData.value) + buttonApi.submitForm(param, !formData.value.id).then((res) => { + onClose() + emit('successful') }) + }) } // 调用这个函数将子组件的一些数据和方法暴露出去 diff --git a/snowy-admin-web/src/views/sys/resource/field/form.vue b/snowy-admin-web/src/views/sys/resource/field/form.vue index a60aa386..eb554591 100644 --- a/snowy-admin-web/src/views/sys/resource/field/form.vue +++ b/snowy-admin-web/src/views/sys/resource/field/form.vue @@ -63,19 +63,17 @@ } // 验证并提交数据 const onSubmit = () => { - formRef.value - .validate() - .then(() => { - const defParam = { - category: 'FIELD', - parentId: recordData.value.id - } - const param = Object.assign(defParam, formData.value) - fieldApi.submitForm(param, !formData.value.id).then((res) => { - onClose() - emit('successful') - }) + formRef.value.validate().then(() => { + const defParam = { + category: 'FIELD', + parentId: recordData.value.id + } + const param = Object.assign(defParam, formData.value) + fieldApi.submitForm(param, !formData.value.id).then((res) => { + onClose() + emit('successful') }) + }) } // 调用这个函数将子组件的一些数据和方法暴露出去 defineExpose({ diff --git a/snowy-admin-web/src/views/sys/resource/menu/changeModuleForm.vue b/snowy-admin-web/src/views/sys/resource/menu/changeModuleForm.vue index e18a68f1..88d86972 100644 --- a/snowy-admin-web/src/views/sys/resource/menu/changeModuleForm.vue +++ b/snowy-admin-web/src/views/sys/resource/menu/changeModuleForm.vue @@ -10,21 +10,16 @@ > - {{formData.title}} + {{ formData.title }} - + - + {{ module.title }} - 关闭 @@ -65,26 +60,27 @@ // 默认要校验的 const formRules = { - module: [required('请选择所属目录')], + module: [required('请选择所属目录')] } // 验证并提交数据 const onSubmit = () => { - formRef.value - .validate() - .then(() => { - const param = { - id: formData.value.id, - module: formData.value.module - } - submitLoading.value = true - menuApi.menuChangeModule(param).then(() => { + formRef.value.validate().then(() => { + const param = { + id: formData.value.id, + module: formData.value.module + } + submitLoading.value = true + menuApi + .menuChangeModule(param) + .then(() => { submitLoading.value = false emit('successful') - }).finally(() => { + }) + .finally(() => { visible = false }) - }) + }) } // 调用这个函数将子组件的一些数据和方法暴露出去 defineExpose({ diff --git a/snowy-admin-web/src/views/sys/resource/menu/form.vue b/snowy-admin-web/src/views/sys/resource/menu/form.vue index 8a37304a..5fd5c433 100644 --- a/snowy-admin-web/src/views/sys/resource/menu/form.vue +++ b/snowy-admin-web/src/views/sys/resource/menu/form.vue @@ -199,7 +199,8 @@ onClose() emit('successful') }) - }).finally(() => { + }) + .finally(() => { submitLoading.value = false }) } diff --git a/snowy-admin-web/src/views/sys/resource/menu/index.vue b/snowy-admin-web/src/views/sys/resource/menu/index.vue index a26b5d41..d6286fba 100644 --- a/snowy-admin-web/src/views/sys/resource/menu/index.vue +++ b/snowy-admin-web/src/views/sys/resource/menu/index.vue @@ -45,11 +45,11 @@ - {{record.path}} + {{ record.path }} - - {{record.component}} + {{ record.component }} - @@ -101,7 +101,7 @@ - + diff --git a/snowy-admin-web/src/views/sys/resource/module/form.vue b/snowy-admin-web/src/views/sys/resource/module/form.vue index d69ba477..a506212d 100644 --- a/snowy-admin-web/src/views/sys/resource/module/form.vue +++ b/snowy-admin-web/src/views/sys/resource/module/form.vue @@ -74,14 +74,12 @@ // 验证并提交数据 const onSubmit = () => { - formRef.value - .validate() - .then(() => { - moduleApi.submitForm(formData.value, !formData.value.id).then(() => { - onClose() - emit('successful') - }) + formRef.value.validate().then(() => { + moduleApi.submitForm(formData.value, !formData.value.id).then(() => { + onClose() + emit('successful') }) + }) } // 调用这个函数将子组件的一些数据和方法暴露出去 diff --git a/snowy-admin-web/src/views/sys/resource/spa/form.vue b/snowy-admin-web/src/views/sys/resource/spa/form.vue index fa471f9d..da62322f 100644 --- a/snowy-admin-web/src/views/sys/resource/spa/form.vue +++ b/snowy-admin-web/src/views/sys/resource/spa/form.vue @@ -143,18 +143,19 @@ // 验证并提交数据 const onSubmit = () => { - formRef.value - .validate() - .then(() => { - const param = parameterChanges(formData.value) - submitLoading.value = true - spaApi.submitForm(param, !param.id).then(() => { + formRef.value.validate().then(() => { + const param = parameterChanges(formData.value) + submitLoading.value = true + spaApi + .submitForm(param, !param.id) + .then(() => { visible = false emit('successful') - }).finally(() => { + }) + .finally(() => { submitLoading.value = false }) - }) + }) } const parameterChanges = (data) => { if (!data.component) { diff --git a/snowy-admin-web/src/views/sys/role/form.vue b/snowy-admin-web/src/views/sys/role/form.vue index 888e0320..30840313 100644 --- a/snowy-admin-web/src/views/sys/role/form.vue +++ b/snowy-admin-web/src/views/sys/role/form.vue @@ -102,20 +102,18 @@ }) // 验证并提交数据 const onSubmit = () => { - formRef.value - .validate() - .then(() => { - submitLoading.value = true - roleApi - .submitForm(formData.value, !formData.value.id) - .then(() => { - visible = false - emit('successful') - }) - .finally(() => { - submitLoading.value = false - }) - }) + formRef.value.validate().then(() => { + submitLoading.value = true + roleApi + .submitForm(formData.value, !formData.value.id) + .then(() => { + visible = false + emit('successful') + }) + .finally(() => { + submitLoading.value = false + }) + }) } // 调用这个函数将子组件的一些数据和方法暴露出去 defineExpose({ diff --git a/snowy-admin-web/src/views/sys/role/grantMobileResourceForm.vue b/snowy-admin-web/src/views/sys/role/grantMobileResourceForm.vue index 50c0d396..47012330 100644 --- a/snowy-admin-web/src/views/sys/role/grantMobileResourceForm.vue +++ b/snowy-admin-web/src/views/sys/role/grantMobileResourceForm.vue @@ -32,16 +32,16 @@ changeSub(record, val)">{{ - record.title - }} + record.title + }} changeChildCheckBox(record, evt)">{{ - item.title - }} + item.title + }} diff --git a/snowy-admin-web/src/views/sys/role/index.vue b/snowy-admin-web/src/views/sys/role/index.vue index dffa98f4..c681a3d1 100644 --- a/snowy-admin-web/src/views/sys/role/index.vue +++ b/snowy-admin-web/src/views/sys/role/index.vue @@ -225,7 +225,7 @@ } // 可伸缩列 const handleResizeColumn = (w, col) => { - col.width = w; + col.width = w } // 删除 const removeOrg = (record) => { diff --git a/snowy-admin-web/src/views/sys/user/grantPermissionForm.vue b/snowy-admin-web/src/views/sys/user/grantPermissionForm.vue new file mode 100644 index 00000000..86c6e05d --- /dev/null +++ b/snowy-admin-web/src/views/sys/user/grantPermissionForm.vue @@ -0,0 +1,337 @@ + + + + + + + + onCheckAllChange(val)"> 接口 + + + + + changeApi(record, val)"> + {{ record.api }} + + + + + + changeDataScope(record, evt)" + > + + {{ item.title }} + {{ item.title }} + + + 选择机构 + + + + + + + 关闭 + 保存 + + + + + + + + diff --git a/snowy-admin-web/src/views/sys/user/grantResourceForm.vue b/snowy-admin-web/src/views/sys/user/grantResourceForm.vue new file mode 100644 index 00000000..6b33c056 --- /dev/null +++ b/snowy-admin-web/src/views/sys/user/grantResourceForm.vue @@ -0,0 +1,315 @@ + + + + + + + {{ module.title }} + + + + + + changeParent(record, val)"> + {{ record.parentName }} + + + + + changeSub(record, val)">{{ + record.title + }} + + + + + + changeChildCheckBox(record, evt)">{{ + item.title + }} + + + + + + + + + 关闭 + 保存 + + + + + + + diff --git a/snowy-admin-web/src/views/sys/user/impExp.vue b/snowy-admin-web/src/views/sys/user/impExp.vue new file mode 100644 index 00000000..ff3a6b46 --- /dev/null +++ b/snowy-admin-web/src/views/sys/user/impExp.vue @@ -0,0 +1,112 @@ + + + 导入数据格式严格按照系统模板进行数据录入,请点击 + 下载模板 + + + + + + + + + 单击或拖动文件到此区域进行上传 + 仅支持xls、xlsx格式文件 + + + + + + 导入总数:{{ impResultData.totalCount }} 条 + 导入成功:{{ impResultData.successCount }} 条 + + 失败条数:{{ impResultData.errorCount }} 条 + + + + + + + + diff --git a/snowy-admin-web/src/views/sys/user/index.vue b/snowy-admin-web/src/views/sys/user/index.vue index 0e7fb443..1da30401 100644 --- a/snowy-admin-web/src/views/sys/user/index.vue +++ b/snowy-admin-web/src/views/sys/user/index.vue @@ -14,6 +14,36 @@ + + + + + + + + + + + + {{ + item.name + }} + + + + + + + {{ $t('common.searchButton') }} + + searchFormRef.resetFields()"> + + {{ $t('common.resetButton') }} + + + + + - - - - - - - - - - - {{ - item.name - }} - - - - - {{ $t('common.searchButton') }} - searchFormRef.resetFields()">{{ - $t('common.resetButton') - }} - - - - {{ $t('common.addButton') }}{{ $t('model.user') }} - - {{ - $t('common.batchRemoveButton') - }} - - - + + + {{ $t('common.addButton') }}{{ $t('model.user') }} + + + + {{ $t('common.imports') }} + + + + {{ $t('common.batchRemoveButton') }} + @@ -72,26 +77,44 @@ {{ $TOOL.dictTypeData('GENDER', record.gender) }} - + {{ $t('common.editButton') }} - 角色 - - - 重置密码 + + + {{ $t('common.removeButton') }} + - - {{ - $t('common.removeButton') - }} - + + + {{ $t('common.more') }} + + + + + + + {{ $t('user.resetPassword') }} + + + + 授权角色 + + + 授权资源 + + + 授权权限 + + + 导出信息 + + + + @@ -105,14 +128,20 @@ org-url="/sys/user/orgTreeSelector" @onBack="roleBack" /> + + + diff --git a/snowy-admin-web/src/views/sys/user/userCenter.vue b/snowy-admin-web/src/views/sys/user/userCenter.vue index 4f0a7797..663250bc 100644 --- a/snowy-admin-web/src/views/sys/user/userCenter.vue +++ b/snowy-admin-web/src/views/sys/user/userCenter.vue @@ -64,7 +64,7 @@
+ +
单击或拖动文件到此区域进行上传
仅支持xls、xlsx格式文件
导入总数:{{ impResultData.totalCount }} 条
导入成功:{{ impResultData.successCount }} 条
失败条数:{{ impResultData.errorCount }} 条