From 6c157c6e0629e70ea0698a19bb629832a335cd09 Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Sat, 28 Jun 2025 16:31:39 +0800 Subject: [PATCH] 优化完成员工认证 员工小区功能 --- src/api/staff/staffAppAuthManageApi.js | 40 ++++++++++++++++++++++++++++++++++++++++ src/api/staff/staffCommunityApi.js | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/components/staff/addStaffAppAuth.vue | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/components/staff/addStaffCommunity.vue | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/components/staff/chooseOrgTree.vue | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/components/staff/deleteStaffCommunity.vue | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/i18n/index.js | 3 +++ src/i18n/userI18n.js | 13 +++++++++++++ src/router/index.js | 2 ++ src/router/userRouter.js | 12 ++++++++++++ src/views/staff/staffAppAuthManageLang.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ src/views/staff/staffAppAuthManageList.vue | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/views/staff/staffCommunityLang.js | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/views/staff/staffCommunityList.vue | 219 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 14 files changed, 1007 insertions(+), 0 deletions(-) create mode 100644 src/api/staff/staffAppAuthManageApi.js create mode 100644 src/api/staff/staffCommunityApi.js create mode 100644 src/components/staff/addStaffAppAuth.vue create mode 100644 src/components/staff/addStaffCommunity.vue create mode 100644 src/components/staff/chooseOrgTree.vue create mode 100644 src/components/staff/deleteStaffCommunity.vue create mode 100644 src/i18n/userI18n.js create mode 100644 src/router/userRouter.js create mode 100644 src/views/staff/staffAppAuthManageLang.js create mode 100644 src/views/staff/staffAppAuthManageList.vue create mode 100644 src/views/staff/staffCommunityLang.js create mode 100644 src/views/staff/staffCommunityList.vue diff --git a/src/api/staff/staffAppAuthManageApi.js b/src/api/staff/staffAppAuthManageApi.js new file mode 100644 index 0000000..7e9dfed --- /dev/null +++ b/src/api/staff/staffAppAuthManageApi.js @@ -0,0 +1,40 @@ +import request from '@/utils/request' +import { getCommunityId } from '@/api/community/communityApi' + +// 查询员工应用认证信息 +export function queryStaffAppAuth(params) { + return new Promise((resolve, reject) => { + request({ + url: '/staff/queryStaffAppAuth', + method: 'get', + params: { + ...params, + communityId: getCommunityId() + } + }).then(response => { + const res = response.data + resolve(res) + }).catch(error => { + reject(error) + }) + }) +} + +// 生成认证二维码 +export function generatorQrCode(params) { + return new Promise((resolve, reject) => { + request({ + url: '/staff/generatorQrCode', + method: 'get', + params: { + ...params, + communityId: getCommunityId() + } + }).then(response => { + const res = response.data + resolve(res) + }).catch(error => { + reject(error) + }) + }) +} \ No newline at end of file diff --git a/src/api/staff/staffCommunityApi.js b/src/api/staff/staffCommunityApi.js new file mode 100644 index 0000000..806d31a --- /dev/null +++ b/src/api/staff/staffCommunityApi.js @@ -0,0 +1,109 @@ +import request from '@/utils/request' +import { getCommunityId } from '@/api/community/communityApi' + +// 获取员工列表 +export function listStaffs(params) { + return new Promise((resolve, reject) => { + request({ + url: '/query.staff.infos', + method: 'get', + params: { + ...params, + communityId: getCommunityId() + } + }).then(response => { + resolve(response.data) + }).catch(error => { + reject(error) + }) + }) +} + +// 获取员工关联的小区列表 +export function listStaffCommunity(params) { + return new Promise((resolve, reject) => { + request({ + url: '/role.listStaffCommunity', + method: 'get', + params: { + ...params, + communityId: getCommunityId() + } + }).then(response => { + resolve(response.data) + }).catch(error => { + reject(error) + }) + }) +} + +// 获取可关联的小区列表 +export function listWaitStaffCommunity(params) { + return new Promise((resolve, reject) => { + request({ + url: '/role.listWaitStaffCommunity', + method: 'get', + params: { + ...params, + communityId: getCommunityId() + } + }).then(response => { + resolve(response.data) + }).catch(error => { + reject(error) + }) + }) +} + +// 获取组织树 +export function listOrgTree() { + return new Promise((resolve, reject) => { + request({ + url: '/org.listOrgTree', + method: 'get', + params: { + communityId: getCommunityId() + } + }).then(response => { + resolve(response.data) + }).catch(error => { + reject(error) + }) + }) +} + +// 关联小区到员工 +export function saveStaffCommunity(data) { + return new Promise((resolve, reject) => { + request({ + url: '/role.saveStaffCommunity', + method: 'post', + data: { + ...data, + communityId: getCommunityId() + } + }).then(response => { + resolve(response.data) + }).catch(error => { + reject(error) + }) + }) +} + +// 删除员工小区关联 +export function deleteStaffCommunity(data) { + return new Promise((resolve, reject) => { + request({ + url: '/role.deleteStaffCommunity', + method: 'post', + data: { + ...data, + communityId: getCommunityId() + } + }).then(response => { + resolve(response.data) + }).catch(error => { + reject(error) + }) + }) +} \ No newline at end of file diff --git a/src/components/staff/addStaffAppAuth.vue b/src/components/staff/addStaffAppAuth.vue new file mode 100644 index 0000000..a055a6b --- /dev/null +++ b/src/components/staff/addStaffAppAuth.vue @@ -0,0 +1,139 @@ + + + + + \ No newline at end of file diff --git a/src/components/staff/addStaffCommunity.vue b/src/components/staff/addStaffCommunity.vue new file mode 100644 index 0000000..df0696c --- /dev/null +++ b/src/components/staff/addStaffCommunity.vue @@ -0,0 +1,127 @@ + + + + + \ No newline at end of file diff --git a/src/components/staff/chooseOrgTree.vue b/src/components/staff/chooseOrgTree.vue new file mode 100644 index 0000000..314e3a4 --- /dev/null +++ b/src/components/staff/chooseOrgTree.vue @@ -0,0 +1,77 @@ + + + + + \ No newline at end of file diff --git a/src/components/staff/deleteStaffCommunity.vue b/src/components/staff/deleteStaffCommunity.vue new file mode 100644 index 0000000..152aa02 --- /dev/null +++ b/src/components/staff/deleteStaffCommunity.vue @@ -0,0 +1,56 @@ + + + + + \ No newline at end of file diff --git a/src/i18n/index.js b/src/i18n/index.js index f687309..d7411c3 100644 --- a/src/i18n/index.js +++ b/src/i18n/index.js @@ -142,6 +142,7 @@ import { messages as devI18n } from './devI18n' import { messages as resourceI18n } from './resourceI18n' import { messages as carI18n } from './carI18n' import { messages as scmI18n } from './scmI18n' +import { messages as userI18n } from './userI18n' Vue.use(VueI18n) @@ -282,6 +283,7 @@ const messages = { ...resourceI18n.en, ...carI18n.en, ...scmI18n.en, + ...userI18n.en, }, zh: { ...loginMessages.zh, @@ -416,6 +418,7 @@ const messages = { ...resourceI18n.zh, ...carI18n.zh, ...scmI18n.zh, + ...userI18n.zh, } } diff --git a/src/i18n/userI18n.js b/src/i18n/userI18n.js new file mode 100644 index 0000000..508eb7a --- /dev/null +++ b/src/i18n/userI18n.js @@ -0,0 +1,13 @@ +import { messages as staffCommunityMessages } from '../views/staff/staffCommunityLang' +import { messages as staffAppAuthManageMessages } from '../views/staff/staffAppAuthManageLang' + +export const messages = { + en: { + ...staffCommunityMessages.en, + ...staffAppAuthManageMessages.en, + }, + zh: { + ...staffCommunityMessages.zh, + ...staffAppAuthManageMessages.zh, + } +} \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index 5fbb38f..8e53ce0 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -12,6 +12,7 @@ import devRouter from './devRouter' import resourceRouter from './resourceRouter' import carRouter from './carRouter' import scmRouter from './scmRouter' +import userRouter from './userRouter' Vue.use(VueRouter) @@ -632,6 +633,7 @@ const routes = [ ...resourceRouter, ...carRouter, ...scmRouter, + ...userRouter, // 其他子路由可以在这里添加 ] }, diff --git a/src/router/userRouter.js b/src/router/userRouter.js new file mode 100644 index 0000000..b3d40b8 --- /dev/null +++ b/src/router/userRouter.js @@ -0,0 +1,12 @@ +export default [ + { + path: '/pages/staff/staffCommunity', + name: '/pages/staff/staffCommunity', + component: () => import('@/views/staff/staffCommunityList.vue') + }, + { + path:'/pages/property/staffAppAuthManage', + name:'/pages/property/staffAppAuthManage', + component: () => import('@/views/staff/staffAppAuthManageList.vue') + }, +] \ No newline at end of file diff --git a/src/views/staff/staffAppAuthManageLang.js b/src/views/staff/staffAppAuthManageLang.js new file mode 100644 index 0000000..432620f --- /dev/null +++ b/src/views/staff/staffAppAuthManageLang.js @@ -0,0 +1,48 @@ +export const messages = { + en: { + staffAppAuthManage: { + title: 'Authentication Information', + staffName: 'Staff Name', + authType: 'Authentication Type', + authName: 'Authentication Name', + authId: 'Authentication ID', + authStatus: 'Authentication Status', + authTime: 'Authentication Time', + auth: 'Authenticate', + fetchError: 'Failed to fetch authentication data' + }, + addStaffAppAuth: { + title: 'Start Authentication', + authType: 'Authentication Type', + qrcode: 'QR Code', + scanTip: 'Please scan the QR code with WeChat for authentication', + finishScan: 'Scan Completed', + requiredSelect: 'Required, please select authentication type', + wechat: 'WeChat', + qrcodeError: 'Failed to generate QR code' + } + }, + zh: { + staffAppAuthManage: { + title: '认证信息', + staffName: '员工名称', + authType: '认证方式', + authName: '认证名称', + authId: '认证ID', + authStatus: '认证状态', + authTime: '认证时间', + auth: '认证', + fetchError: '获取认证数据失败' + }, + addStaffAppAuth: { + title: '开始认证', + authType: '认证方式', + qrcode: '二维码', + scanTip: '请用微信扫一扫二维码认证', + finishScan: '扫码完成', + requiredSelect: '必填,请选择认证方式', + wechat: '微信', + qrcodeError: '生成二维码失败' + } + } +} \ No newline at end of file diff --git a/src/views/staff/staffAppAuthManageList.vue b/src/views/staff/staffAppAuthManageList.vue new file mode 100644 index 0000000..a574b99 --- /dev/null +++ b/src/views/staff/staffAppAuthManageList.vue @@ -0,0 +1,106 @@ + + + + + \ No newline at end of file diff --git a/src/views/staff/staffCommunityLang.js b/src/views/staff/staffCommunityLang.js new file mode 100644 index 0000000..ab3d7cd --- /dev/null +++ b/src/views/staff/staffCommunityLang.js @@ -0,0 +1,56 @@ +export const messages = { + en: { + staffCommunity: { + orgPlaceholder: 'Select organization', + staffNamePlaceholder: 'Enter staff name', + linkCommunity: 'Link Community', + staffName: 'Staff Name', + staffId: 'Staff ID', + communityId: 'Community ID', + communityName: 'Community Name', + operation: 'Operation', + chooseOrgTitle: 'Select Organization', + fetchOrgError: 'Failed to load organization data', + selectOrgTip: 'Please select an organization', + addCommunityTitle: 'Add Community', + communityNamePlaceholder: 'Enter community name', + communityAddress: 'Community Address', + fetchCommunityError: 'Failed to load community data', + selectCommunityTip: 'Please select at least one community', + addSuccess: 'Added successfully', + addError: 'Failed to add', + deleteConfirmTitle: 'Confirm Delete', + deleteConfirmText: 'Are you sure to delete this community association?', + deleteSuccess: 'Deleted successfully', + deleteError: 'Failed to delete', + fetchStaffError: 'Failed to load staff data' + } + }, + zh: { + staffCommunity: { + orgPlaceholder: '选择组织', + staffNamePlaceholder: '输入员工名称', + linkCommunity: '关联小区', + staffName: '员工名称', + staffId: '员工编号', + communityId: '小区编号', + communityName: '小区名称', + operation: '操作', + chooseOrgTitle: '选择组织', + fetchOrgError: '加载组织数据失败', + selectOrgTip: '请选择组织', + addCommunityTitle: '添加小区', + communityNamePlaceholder: '输入小区名称', + communityAddress: '小区地址', + fetchCommunityError: '加载小区数据失败', + selectCommunityTip: '请至少选择一个小', + addSuccess: '添加成功', + addError: '添加失败', + deleteConfirmTitle: '确认删除', + deleteConfirmText: '确定删除该小区关联吗?', + deleteSuccess: '删除成功', + deleteError: '删除失败', + fetchStaffError: '加载员工数据失败' + } + } +} \ No newline at end of file diff --git a/src/views/staff/staffCommunityList.vue b/src/views/staff/staffCommunityList.vue new file mode 100644 index 0000000..d3ec2dc --- /dev/null +++ b/src/views/staff/staffCommunityList.vue @@ -0,0 +1,219 @@ + + + + + \ No newline at end of file -- libgit2 0.21.4