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 }} -