From 5b46da480a5af3cd2b84e7946d60960eee875379 Mon Sep 17 00:00:00 2001 From: Matrix-X Date: Thu, 30 May 2024 20:57:19 +0800 Subject: [PATCH 1/2] refact(user): change employee to user --- doc/Develop.md | 4 +- package-lock.json | 32 ++- package.json | 3 +- src/api/common.ts | 35 ++- src/api/crm/market/store.ts | 2 +- src/api/crm/product-service/artisan.ts | 2 +- src/api/employee.ts | 161 ------------ src/api/permission.ts | 28 +-- src/api/scrm/customer/index.ts | 2 +- src/api/scrm/{employee => user}/index.ts | 40 ++- src/api/user.ts | 156 ++++++++++++ src/api/wechat/official-account/menu.ts | 2 +- src/locale/en-US.ts | 15 +- src/locale/zh-CN.ts | 12 +- src/main.ts | 1 - src/router/routes/modules/admin.ts | 28 +-- src/router/routes/modules/scrm.ts | 22 +- .../components/create-department.vue | 8 +- .../department/components/edit-department.vue | 8 +- .../{role-employee.vue => role-user.vue} | 45 ++-- src/views/admin/permission/role/index.vue | 22 +- .../components/create-department.vue | 8 +- .../components/create-user.vue} | 10 +- .../components/department-side.vue | 2 +- .../components/edit-user.vue} | 24 +- .../components/search-user-table.vue} | 81 +++--- .../admin/{employee => user}/detail/index.vue | 36 +-- src/views/admin/{employee => user}/index.vue | 28 +-- .../admin/{employee => user}/locale/en-US.ts | 2 +- .../admin/{employee => user}/locale/zh-CN.ts | 2 +- src/views/crm/market/brand-story/index.vue | 8 +- .../market/store/components/create-store.vue | 2 +- .../market/store/components/edit-store.vue | 2 +- src/views/crm/market/store/index.vue | 22 +- .../artisan/components/edit-artisan.vue | 2 +- .../components/edit-category.vue | 4 +- .../category/components/edit-category.vue | 4 +- .../scrm/app/components/send-message.vue | 16 +- .../customer/components/add-tag.vue | 2 +- .../tag/components/edit-tag.vue | 2 +- src/views/scrm/customer-domain/tag/index.vue | 4 +- .../group/components/send-message.vue | 16 +- .../enterprise-qr/components/edit-qr.vue | 4 +- .../enterprise-qr/index.vue | 18 +- .../index.vue | 0 .../wechat/group/components/add-group.vue | 18 +- src/views/scrm/wechat/organization/index_.vue | 231 ++++++++++++++++++ .../components/department-side.vue | 0 .../scrm/wechat/{employee => user}/index.vue | 22 +- .../wechat/official-account/media/index.vue | 4 +- .../wechat/official-account/menu/index.vue | 4 +- 51 files changed, 715 insertions(+), 491 deletions(-) delete mode 100644 src/api/employee.ts rename src/api/scrm/{employee => user}/index.ts (50%) create mode 100644 src/api/user.ts rename src/views/admin/permission/role/components/{role-employee.vue => role-user.vue} (67%) rename src/views/admin/{employee => user}/components/create-department.vue (96%) rename src/views/admin/{employee/components/create-employee.vue => user/components/create-user.vue} (95%) rename src/views/admin/{employee => user}/components/department-side.vue (96%) rename src/views/admin/{employee/components/edit-employee.vue => user/components/edit-user.vue} (90%) rename src/views/admin/{employee/components/search-employee-table.vue => user/components/search-user-table.vue} (79%) rename src/views/admin/{employee => user}/detail/index.vue (83%) rename src/views/admin/{employee => user}/index.vue (61%) rename src/views/admin/{employee => user}/locale/en-US.ts (90%) rename src/views/admin/{employee => user}/locale/zh-CN.ts (89%) rename src/views/scrm/operation/{employee-group-send-history => user-group-send-history}/index.vue (100%) create mode 100644 src/views/scrm/wechat/organization/index_.vue rename src/views/scrm/wechat/{employee => user}/components/department-side.vue (100%) rename src/views/scrm/wechat/{employee => user}/index.vue (85%) diff --git a/doc/Develop.md b/doc/Develop.md index 695e5c3..dab4851 100644 --- a/doc/Develop.md +++ b/doc/Develop.md @@ -70,7 +70,7 @@ const Home: AppRouteRecordRaw = { // 子级Route组件会被嵌入到PageLayout, 即内容区域 component: () => import('@/views/home/index.vue'), meta: { - locale: 'menu.admin.employee', + locale: 'menu.admin.user', // 登录态 requiresAuth: true, // 路由所需角色, ['*']允许所有角色 @@ -79,4 +79,4 @@ const Home: AppRouteRecordRaw = { } ], }; -``` \ No newline at end of file +``` diff --git a/package-lock.json b/package-lock.json index 0cd9ff1..14f77db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@fullcalendar/timegrid": "^6.1.6", "@fullcalendar/vue3": "^6.1.6", "@vueuse/core": "^9.3.0", - "@yaoyaochi/weyui": "^1.4.0", + "@yaoyaochi/weyui": "^1.4.7", "axios": "^0.24.0", "dayjs": "^1.11.7", "lodash": "^4.17.21", @@ -62,6 +62,7 @@ "prettier": "^3.0.3", "rollup": "3.29.4", "rollup-plugin-visualizer": "5.9.2", + "sass": "^1.69.5", "stylelint": "^15.10.3", "stylelint-config-rational-order-fix": "^0.1.9", "stylelint-config-recommended-vue": "^1.5.0", @@ -2205,9 +2206,9 @@ } }, "node_modules/@yaoyaochi/weyui": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@yaoyaochi/weyui/-/weyui-1.4.0.tgz", - "integrity": "sha512-j0+ZzZRHC7FljJ6dcC2cm3B8eyTzVOvXTDwfLZzRtesQxVViuqrFn1mY1C4LO2qQ/qPlx3nsqpTHdj13TwdDVQ==" + "version": "1.4.7", + "resolved": "http://npm.moonwife.top/@yaoyaochi/weyui/-/weyui-1.4.7.tgz", + "integrity": "sha512-o2kFdgRyZBU7icZlrHNIAw2CWO1sH2zaR9BHQS9DifA586NHhz5yqjwo3RmcrfpAoL4eXOyGdSDcrw+quzFj/w==" }, "node_modules/acorn": { "version": "8.10.0", @@ -5091,6 +5092,12 @@ "node": ">=0.10.0" } }, + "node_modules/immutable": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.4.tgz", + "integrity": "sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA==", + "dev": true + }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmmirror.com/import-fresh/-/import-fresh-3.3.0.tgz", @@ -7678,6 +7685,23 @@ "license": "MIT", "optional": true }, + "node_modules/sass": { + "version": "1.69.5", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.69.5.tgz", + "integrity": "sha512-qg2+UCJibLr2LCVOt3OlPhr/dqVHWOa9XtZf2OjbLs/T4VPSJ00udtgJxH3neXZm+QqX8B+3cU7RaLqp1iVfcQ==", + "dev": true, + "dependencies": { + "chokidar": ">=3.0.0 <4.0.0", + "immutable": "^4.0.0", + "source-map-js": ">=0.6.2 <2.0.0" + }, + "bin": { + "sass": "sass.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/sax": { "version": "1.3.0", "resolved": "https://registry.npmmirror.com/sax/-/sax-1.3.0.tgz", diff --git a/package.json b/package.json index 49006a5..9af29f5 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@fullcalendar/timegrid": "^6.1.6", "@fullcalendar/vue3": "^6.1.6", "@vueuse/core": "^9.3.0", - "@yaoyaochi/weyui": "^1.4.0", + "@yaoyaochi/weyui": "^1.4.7", "axios": "^0.24.0", "dayjs": "^1.11.7", "lodash": "^4.17.21", @@ -83,6 +83,7 @@ "prettier": "^3.0.3", "rollup": "3.29.4", "rollup-plugin-visualizer": "5.9.2", + "sass": "^1.69.5", "stylelint": "^15.10.3", "stylelint-config-rational-order-fix": "^0.1.9", "stylelint-config-recommended-vue": "^1.5.0", diff --git a/src/api/common.ts b/src/api/common.ts index bcedf2c..7d92092 100644 --- a/src/api/common.ts +++ b/src/api/common.ts @@ -8,7 +8,7 @@ import { Pagination } from '@/types/global'; * @version v1 */ -export interface EmployeeOption { +export interface UserOption { id: number; avatar: string; account: string; @@ -17,43 +17,40 @@ export interface EmployeeOption { phoneNumber: string; } -export interface GetEmployeeOptionsRequest extends Pagination { +export interface GetUserOptionsRequest extends Pagination { likeName?: string; likeEmail?: string; likePhoneNumber?: string; } -export interface GetEmployeeOptionsReply extends Pagination { - list: EmployeeOption[]; +export interface GetUserOptionsReply extends Pagination { + list: UserOption[]; } -export function getEmployeeOptions(request: GetEmployeeOptionsRequest) { - return axios.get( - '/api/v1/admin/common/options/employees', - { - params: request, - }, - ); +export function getUserOptions(request: GetUserOptionsRequest) { + return axios.get('/api/v1/admin/common/options/users', { + params: request, + }); } -export interface EmployeeQueryRoleOption { +export interface UserQueryRoleOption { roleCode: string; roleName: string; } -export interface EmployeeQueryDepartmentOption { +export interface UserQueryDepartmentOption { departmentId: number; departmentName: string; } -export interface GetEmployeeQueryOptionsReply { - roles: EmployeeQueryRoleOption[]; - departments: EmployeeQueryDepartmentOption[]; +export interface GetUserQueryOptionsReply { + roles: UserQueryRoleOption[]; + departments: UserQueryDepartmentOption[]; } -export function getEmployeeQueryOptions() { - return axios.get( - '/api/v1/admin/common/options/employee-query', +export function getUserQueryOptions() { + return axios.get( + '/api/v1/admin/common/options/user-query', ); } diff --git a/src/api/crm/market/store.ts b/src/api/crm/market/store.ts index 88ab6af..5fd8c04 100644 --- a/src/api/crm/market/store.ts +++ b/src/api/crm/market/store.ts @@ -9,7 +9,7 @@ const UriStore = '/stores'; export interface Store extends PowerModel, MediaSet { name: string; - employeeId?: number; + userId?: number; contactNumber: string; address: string; description: string; diff --git a/src/api/crm/product-service/artisan.ts b/src/api/crm/product-service/artisan.ts index 252fcf4..c49ec26 100644 --- a/src/api/crm/product-service/artisan.ts +++ b/src/api/crm/product-service/artisan.ts @@ -8,7 +8,7 @@ import { MediaSet } from '@/api/media-resource'; const UriArtisan = '/artisans'; export interface Artisan extends PowerModel, MediaSet { - employeeId?: number; + userId?: number; name: string; level?: number; gender: boolean; diff --git a/src/api/employee.ts b/src/api/employee.ts deleted file mode 100644 index 2189167..0000000 --- a/src/api/employee.ts +++ /dev/null @@ -1,161 +0,0 @@ -import axios from 'axios'; -import { Position } from '@/api/position'; -import { Pagination } from '@/types/global'; - -/** - * Employee - * @description 员工管理 - */ - -export interface EmployeeDepartment { - depId: number; - depName: string; -} - -export interface Employee { - id: number; - account: string; - name: string; - email: string; - mobilePhone: string; - gender: string; - nickName?: string; - desc?: string; - avatar?: string; - externalEmail?: string; - roles: string[]; - department?: EmployeeDepartment; - position?: Position; - positionId?: number; - jobTitle: string; - isEnabled: boolean; - createdAt: string; -} - -export interface GetEmployeeRequest { - id: number; -} - -export type GetEmployeeReply = Employee; -export function getEmployee(request: GetEmployeeRequest) { - return axios.get( - `/api/v1/admin/employee/employees/${request.id}`, - ); -} - -export interface ListEmployeesRequest extends Pagination { - ids?: number[]; - likeName?: string; - likeEmail?: string; - depIds?: number[]; - positionIds?: []; - likePhoneNumber?: string; - roleCodes?: string[]; - isEnable?: any; -} - -export interface ListEmployeesReply extends Pagination { - list: Employee[]; -} - -export function listEmployees(request: ListEmployeesRequest) { - return axios.get('/api/v1/admin/employee/employees', { - params: request, - }); -} - -export interface SyncEmployeesRequest { - source: string; - target: string; -} - -export interface SyncEmployeesReply { - status: boolean; -} - -export function syncEmployees(request: SyncEmployeesRequest) { - return axios.post( - '/api/v1/admin/employee/employees/actions/sync', - request, - ); -} - -export interface CreateEmployeeRequest { - account: string; - name: string; - nickName?: string; - desc?: string; - email: string; - avatar?: string; - externalEmail?: string; - mobilePhone?: string; - gender: string; - depId: number; - position?: string; - jobTitle?: string; - password?: string; -} - -export interface CreateEmployeeReply { - id: number; -} - -export function createEmployee(request: CreateEmployeeRequest) { - return axios.post( - '/api/v1/admin/employee/employees', - request, - ); -} - -export interface UpdateEmployeeRequest { - id: number; - name?: string; - nickName?: string; - desc?: string; - email?: string; - avatar?: string; - externalEmail?: string; - mobilePhone?: string; - gender?: string; - depId?: number; - positionId?: number; - jobTitle?: string; - password?: string; - status?: string; -} - -export type UpdateEmployeeReply = Employee; - -export function updateEmployee(request: UpdateEmployeeRequest) { - return axios.patch( - `/api/v1/admin/employee/employees/${request.id}`, - request, - ); -} - -export interface DeleteEmployeeRequest { - id: number; -} - -export interface DeleteEmployeeReply { - id: number; -} - -export function deleteEmployee(request: DeleteEmployeeRequest) { - return axios.delete( - `/api/v1/admin/employee/employees/${request.id}`, - ); -} - -export interface ResetPasswordReply { - status: string; -} - -export function resetPassword(userId: number) { - return axios.post( - `/api/v1/admin/employee/employees/actions/reset-password`, - { - userId, - }, - ); -} diff --git a/src/api/permission.ts b/src/api/permission.ts index 33d5ea9..bf42858 100644 --- a/src/api/permission.ts +++ b/src/api/permission.ts @@ -105,31 +105,31 @@ export function listAPI(request: ListAPIRequest) { }); } -export interface GetRoleEmployeesRequest extends Pagination { +export interface GetRoleUsersRequest extends Pagination { roleCode: string; } -export interface RoleEmployeeDepartment { +export interface RoleUserDepartment { id: number; name: string; } -export interface RoleEmployee { +export interface RoleUser { id: number; name: string; nickname: string; account: string; phoneNumber: string; - department?: RoleEmployeeDepartment; + department?: RoleUserDepartment; email: string; } -export interface GetRoleEmployeesReply extends Pagination { - list: RoleEmployee[]; +export interface GetRoleUsersReply extends Pagination { + list: RoleUser[]; } -export function getRoleEmployees(request: GetRoleEmployeesRequest) { - return axios.get( +export function getRoleUsers(request: GetRoleUsersRequest) { + return axios.get( `/api/v1/admin/permission/roles/${request.roleCode}/users`, { params: request }, ); @@ -151,18 +151,18 @@ export function setUserRoles(request: SetUserRolesRequest) { ); } -interface SetRoleEmployeesRequest { +interface SetRoleUsersRequest { roleCode: string; - employeeIds: number[]; + userIds: number[]; } -interface SetRoleEmployeesReply { +interface SetRoleUsersReply { status: string; } -export function setRoleEmployees(request: SetRoleEmployeesRequest) { - return axios.post( - `/api/v1/admin/permission/roles/${request.roleCode}/actions/set-employees`, +export function setRoleUsers(request: SetRoleUsersRequest) { + return axios.post( + `/api/v1/admin/permission/roles/${request.roleCode}/actions/set-users`, request, ); } diff --git a/src/api/scrm/customer/index.ts b/src/api/scrm/customer/index.ts index 805c900..08786dd 100644 --- a/src/api/scrm/customer/index.ts +++ b/src/api/scrm/customer/index.ts @@ -12,7 +12,7 @@ import axios from 'axios'; * @description scrm客户管理 */ -export interface EmployeeDepartment { +export interface UserDepartment { depId: number; depName: string; } diff --git a/src/api/scrm/employee/index.ts b/src/api/scrm/user/index.ts similarity index 50% rename from src/api/scrm/employee/index.ts rename to src/api/scrm/user/index.ts index 37f4386..7520b7b 100644 --- a/src/api/scrm/employee/index.ts +++ b/src/api/scrm/user/index.ts @@ -1,16 +1,16 @@ import axios from 'axios'; /** - * Employee + * User * @description 员工管理 */ -export interface EmployeeDepartment { +export interface UserDepartment { depId: number; depName: string; } -export interface Employee { +export interface User { id: number; account: string; name: string; @@ -22,25 +22,23 @@ export interface Employee { avatar?: string; externalEmail?: string; roles: string[]; - department?: EmployeeDepartment; + department?: UserDepartment; position: string; jobTitle: string; isEnabled: boolean; createdAt: string; } -export interface GetEmployeeRequest { +export interface GetUserRequest { id: string; } -export type GetEmployeeReply = Employee; -export function getEmployee(request: GetEmployeeRequest) { - return axios.get( - `/api/v1/admin/employee/employees/${request.id}`, - ); +export type GetUserReply = User; +export function getUser(request: GetUserRequest) { + return axios.get(`/api/v1/admin/user/users/${request.id}`); } -export interface ListEmployeesRequest { +export interface ListUsersRequest { id?: any; name?: string; email?: string; @@ -55,33 +53,33 @@ export interface ListEmployeesRequest { likeName?: string; } -export interface ListEmployeesReply { - list: Employee[]; +export interface ListUsersReply { + list: User[]; pageIndex: number; pageSize: number; total: number; children?: any[]; } -export function listEmployees(request: ListEmployeesRequest) { - return axios.post( - '/api/v1/admin/scrm/organization/wechat/employee/page', +export function listUsers(request: ListUsersRequest) { + return axios.post( + '/api/v1/admin/scrm/organization/wechat/user/page', request, ); } -export interface SyncEmployeesRequest { +export interface SyncUsersRequest { source: string; target: string; } -export interface SyncEmployeesReply { +export interface SyncUsersReply { status: boolean; } -export function syncEmployees(request: SyncEmployeesRequest) { - return axios.post( - '/api/v1/admin/employee/employees/actions/sync', +export function syncUsers(request: SyncUsersRequest) { + return axios.post( + '/api/v1/admin/user/users/actions/sync', request, ); } diff --git a/src/api/user.ts b/src/api/user.ts new file mode 100644 index 0000000..6a40787 --- /dev/null +++ b/src/api/user.ts @@ -0,0 +1,156 @@ +import axios from 'axios'; +import { Position } from '@/api/position'; +import { Pagination } from '@/types/global'; + +/** + * User + * @description 员工管理 + */ + +export interface UserDepartment { + depId: number; + depName: string; +} + +export interface User { + id: number; + account: string; + name: string; + email: string; + mobilePhone: string; + gender: string; + nickName?: string; + desc?: string; + avatar?: string; + externalEmail?: string; + roles: string[]; + department?: UserDepartment; + position?: Position; + positionId?: number; + jobTitle: string; + isEnabled: boolean; + createdAt: string; +} + +export interface GetUserRequest { + id: number; +} + +export type GetUserReply = User; +export function getUser(request: GetUserRequest) { + return axios.get(`/api/v1/admin/user/users/${request.id}`); +} + +export interface ListUsersRequest extends Pagination { + ids?: number[]; + likeName?: string; + likeEmail?: string; + depIds?: number[]; + positionIds?: []; + likePhoneNumber?: string; + roleCodes?: string[]; + isEnable?: any; +} + +export interface ListUsersReply extends Pagination { + list: User[]; +} + +export function listUsers(request: ListUsersRequest) { + return axios.get('/api/v1/admin/user/users', { + params: request, + }); +} + +export interface SyncUsersRequest { + source: string; + target: string; +} + +export interface SyncUsersReply { + status: boolean; +} + +export function syncUsers(request: SyncUsersRequest) { + return axios.post( + '/api/v1/admin/user/users/actions/sync', + request, + ); +} + +export interface CreateUserRequest { + account: string; + name: string; + nickName?: string; + desc?: string; + email: string; + avatar?: string; + externalEmail?: string; + mobilePhone?: string; + gender: string; + depId: number; + position?: string; + jobTitle?: string; + password?: string; +} + +export interface CreateUserReply { + id: number; +} + +export function createUser(request: CreateUserRequest) { + return axios.post('/api/v1/admin/user/users', request); +} + +export interface UpdateUserRequest { + id: number; + name?: string; + nickName?: string; + desc?: string; + email?: string; + avatar?: string; + externalEmail?: string; + mobilePhone?: string; + gender?: string; + depId?: number; + positionId?: number; + jobTitle?: string; + password?: string; + status?: string; +} + +export type UpdateUserReply = User; + +export function updateUser(request: UpdateUserRequest) { + return axios.patch( + `/api/v1/admin/user/users/${request.id}`, + request, + ); +} + +export interface DeleteUserRequest { + id: number; +} + +export interface DeleteUserReply { + id: number; +} + +export function deleteUser(request: DeleteUserRequest) { + return axios.delete( + `/api/v1/admin/user/users/${request.id}`, + ); +} + +export interface ResetPasswordReply { + status: string; +} + +export function resetPassword(userId: number) { + return axios.post( + `/api/v1/admin/user/users/actions/reset-password`, + { + userId, + }, + ); +} diff --git a/src/api/wechat/official-account/menu.ts b/src/api/wechat/official-account/menu.ts index e571b48..098c6cf 100644 --- a/src/api/wechat/official-account/menu.ts +++ b/src/api/wechat/official-account/menu.ts @@ -22,7 +22,7 @@ export interface SyncOAMenuReply { } export function syncOAMenu(request: SyncOAMenuRequest) { - return axios.put( + return axios.post( `${PrefixUriAdmin + UriOAMenu}/sync`, request, ); diff --git a/src/locale/en-US.ts b/src/locale/en-US.ts index 90d7904..52a6b41 100644 --- a/src/locale/en-US.ts +++ b/src/locale/en-US.ts @@ -1,7 +1,7 @@ import localeMessageBox from '@/components/message-box/locale/en-US'; import localeLogin from '@/views/login/locale/en-US'; -import localeEmployee from '@/views/admin/employee/locale/en-US'; +import localeUser from '@/views/admin/user/locale/en-US'; import localeSettings from './en-US/settings'; @@ -26,8 +26,8 @@ export default { 'navbar.action.locale': 'Switch to English', 'menu.admin': 'System Management', - 'menu.admin.employee': 'Employee Management', - 'menu.admin.employee.detail': 'Employee Details', + 'menu.admin.user': 'User Management', + 'menu.admin.user.detail': 'User Details', 'menu.admin.permission': 'Permission Management', 'menu.admin.permission.role': 'Role Management', 'menu.admin.dictionary': 'Data Dictionary', @@ -77,8 +77,7 @@ export default { 'menu.scrm.operation.groupSend': 'Customer Group Messaging', 'menu.scrm.operation.welcomeScript': 'Group Welcome Message', 'menu.scrm.operation.moment': 'Enterprise WeChat Moments', - 'menu.scrm.operation.employeeGroupSendHistory': - 'Employee Group Messaging History', + 'menu.scrm.operation.userGroupSendHistory': 'User Group Messaging History', 'menu.scrm.customerDomain': 'Customer Domain Management', 'menu.scrm.customerDomain.customer': 'Customer Management', 'menu.scrm.customerDomain.customer.detail': 'Customer Details', @@ -90,8 +89,8 @@ export default { 'menu.scrm.customerGroup.tag': 'Customer Group Tags', 'menu.scrm.wechat': 'Enterprise Management', 'menu.scrm.wechat.organization': 'Department Management', - 'menu.scrm.wechat.employees': 'Employees Management', - 'menu.scrm.wechat.group': 'Employee Group Management', + 'menu.scrm.wechat.users': 'Users Management', + 'menu.scrm.wechat.group': 'User Group Management', 'menu.scrm.app': 'Application Management', 'menu.scrm.sessionArchive': 'Session Archive', 'menu.scrm.smartCS': 'Smart Customer Service', @@ -105,5 +104,5 @@ export default { ...localeSettings, ...localeMessageBox, ...localeLogin, - ...localeEmployee, + ...localeUser, }; diff --git a/src/locale/zh-CN.ts b/src/locale/zh-CN.ts index 4ddbd6e..b5274d5 100644 --- a/src/locale/zh-CN.ts +++ b/src/locale/zh-CN.ts @@ -1,7 +1,7 @@ import localeMessageBox from '@/components/message-box/locale/zh-CN'; import localeLogin from '@/views/login/locale/zh-CN'; -import localeEmployee from '@/views/admin/employee/locale/zh-CN'; +import localeUser from '@/views/admin/user/locale/zh-CN'; import localeSettings from './zh-CN/settings'; @@ -26,8 +26,8 @@ export default { 'navbar.action.locale': '切换为中文', 'menu.admin': '系统管理', - 'menu.admin.employee': '员工管理', - 'menu.admin.employee.detail': '员工详情', + 'menu.admin.user': '员工管理', + 'menu.admin.user.detail': '员工详情', 'menu.admin.permission': '权限管理', 'menu.admin.permission.role': '角色管理', 'menu.admin.dictionary': '数据字典', @@ -77,7 +77,7 @@ export default { 'menu.scrm.operation.groupSend': '客户群发', 'menu.scrm.operation.welcomeScript': '入群欢迎语', 'menu.scrm.operation.moment': '企微朋友圈', - 'menu.scrm.operation.employeeGroupSendHistory': '员工群发记录', + 'menu.scrm.operation.userGroupSendHistory': '员工群发记录', 'menu.scrm.customerDomain': '客域管理', 'menu.scrm.customerDomain.customer': '客户管理', 'menu.scrm.customerDomain.customer.detail': '客户详情', @@ -89,7 +89,7 @@ export default { 'menu.scrm.customerGroup.tag': '客户群标签', 'menu.scrm.wechat': '企业管理', 'menu.scrm.wechat.organization': '部门管理', - 'menu.scrm.wechat.employees': '员工管理', + 'menu.scrm.wechat.users': '员工管理', 'menu.scrm.wechat.group': '员工群管理', 'menu.scrm.app': '应用管理', 'menu.scrm.sessionArchive': '会话存档', @@ -107,5 +107,5 @@ export default { ...localeSettings, ...localeMessageBox, ...localeLogin, - ...localeEmployee, + ...localeUser, }; diff --git a/src/main.ts b/src/main.ts index 7607357..8f0b86e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,7 +4,6 @@ import globalComponents from '@/components'; import WujieVue from 'wujie-vue3'; import { loadPluginRoutes } from '@/router/routes'; import WeyUI from '@yaoyaochi/weyui'; -// import '@yaoyaochi/weyui/lib/style.css'; import router from './router'; import store from './store'; import i18n from './locale'; diff --git a/src/router/routes/modules/admin.ts b/src/router/routes/modules/admin.ts index 4b27ca7..a61ae1d 100644 --- a/src/router/routes/modules/admin.ts +++ b/src/router/routes/modules/admin.ts @@ -12,36 +12,36 @@ const Admin: AppRouteRecordRaw = { icon: 'icon-tool', }, children: [ - // employee + // user { - path: '/admin/employee', - name: 'Employee', + path: '/admin/user', + name: 'User', component: EMPTY_LAYOUT, - redirect: '/admin/employee/list', + redirect: '/admin/user/list', meta: { icon: 'icon-user', - locale: 'menu.admin.employee', + locale: 'menu.admin.user', requiresAuth: true, roles: ['*'], hideChildrenInMenu: true, }, children: [ { - path: '/admin/employee/list', - name: 'EmployeeList', - component: () => import('@/views/admin/employee/index.vue'), + path: '/admin/user/list', + name: 'UserList', + component: () => import('@/views/admin/user/index.vue'), meta: { - locale: 'menu.admin.employee', + locale: 'menu.admin.user', requiresAuth: true, roles: ['*'], }, }, { - path: '/admin/employee/detail/:id', - name: 'EmployeeDetail', - component: () => import('@/views/admin/employee/detail/index.vue'), + path: '/admin/user/detail/:id', + name: 'UserDetail', + component: () => import('@/views/admin/user/detail/index.vue'), meta: { - locale: 'menu.admin.employee.detail', + locale: 'menu.admin.user.detail', requiresAuth: true, roles: ['*'], }, @@ -62,7 +62,7 @@ const Admin: AppRouteRecordRaw = { children: [ { path: '/admin/organization/department', - name: 'OrganizationEmployee', + name: 'OrganizationUser', component: EMPTY_LAYOUT, redirect: '/admin/organization/department/list', meta: { diff --git a/src/router/routes/modules/scrm.ts b/src/router/routes/modules/scrm.ts index 8544d71..190d5b5 100644 --- a/src/router/routes/modules/scrm.ts +++ b/src/router/routes/modules/scrm.ts @@ -135,14 +135,12 @@ const Scrm: AppRouteRecordRaw = { }, }, { - path: '/scrm/operation/employee-group-send-history', - name: 'WeWorkEmployeeGroupSendHistory', + path: '/scrm/operation/user-group-send-history', + name: 'WeWorkUserGroupSendHistory', component: () => - import( - '@/views/scrm/operation/employee-group-send-history/index.vue' - ), + import('@/views/scrm/operation/user-group-send-history/index.vue'), meta: { - locale: 'menu.scrm.operation.employeeGroupSendHistory', + locale: 'menu.scrm.operation.userGroupSendHistory', requiresAuth: true, roles: ['*'], hideChildrenInMenu: true, @@ -287,7 +285,9 @@ const Scrm: AppRouteRecordRaw = { { path: '/scrm/wechat/organization', name: 'WeWorkWechatOrganization', - component: () => import('@/views/scrm/wechat/organization/index.vue'), + // component: () => import('@/views/scrm/wechat/organization/index.vue'), + component: () => + import('@/views/scrm/wechat/organization/index_.vue'), meta: { locale: 'menu.scrm.wechat.organization', requiresAuth: true, @@ -295,11 +295,11 @@ const Scrm: AppRouteRecordRaw = { }, }, { - path: '/scrm/wechat/employee', - name: 'WeWorkWechatEmployee', - component: () => import('@/views/scrm/wechat/employee/index.vue'), + path: '/scrm/wechat/user', + name: 'WeWorkWechatUser', + component: () => import('@/views/scrm/wechat/user/index.vue'), meta: { - locale: 'menu.scrm.wechat.employees', + locale: 'menu.scrm.wechat.users', requiresAuth: true, roles: ['*'], }, diff --git a/src/views/admin/organization/department/components/create-department.vue b/src/views/admin/organization/department/components/create-department.vue index 8ca104f..7c3d289 100644 --- a/src/views/admin/organization/department/components/create-department.vue +++ b/src/views/admin/organization/department/components/create-department.vue @@ -46,9 +46,9 @@ import { createDepartment, CreateDepartmentRequest } from '@/api/department'; import { DepartmentOption, - EmployeeOption, + UserOption, getDepartmentOptions, - getEmployeeOptions, + getUserOptions, } from '@/api/common'; const prop = defineProps({ @@ -101,12 +101,12 @@ const state = reactive({ submitLoading: false }); const option = reactive({ - leaderOptions: [] as Array, + leaderOptions: [] as Array, parentOptions: [] as Array, }); function fetchLeaderOptions(likeName = '') { - return getEmployeeOptions({ likeName }).then((res) => { + return getUserOptions({ likeName }).then((res) => { option.leaderOptions = res.data.list; }); } diff --git a/src/views/admin/organization/department/components/edit-department.vue b/src/views/admin/organization/department/components/edit-department.vue index 8ca104f..7c3d289 100644 --- a/src/views/admin/organization/department/components/edit-department.vue +++ b/src/views/admin/organization/department/components/edit-department.vue @@ -46,9 +46,9 @@ import { createDepartment, CreateDepartmentRequest } from '@/api/department'; import { DepartmentOption, - EmployeeOption, + UserOption, getDepartmentOptions, - getEmployeeOptions, + getUserOptions, } from '@/api/common'; const prop = defineProps({ @@ -101,12 +101,12 @@ const state = reactive({ submitLoading: false }); const option = reactive({ - leaderOptions: [] as Array, + leaderOptions: [] as Array, parentOptions: [] as Array, }); function fetchLeaderOptions(likeName = '') { - return getEmployeeOptions({ likeName }).then((res) => { + return getUserOptions({ likeName }).then((res) => { option.leaderOptions = res.data.list; }); } diff --git a/src/views/admin/permission/role/components/role-employee.vue b/src/views/admin/permission/role/components/role-user.vue similarity index 67% rename from src/views/admin/permission/role/components/role-employee.vue rename to src/views/admin/permission/role/components/role-user.vue index 0612a1c..fd1a9b1 100644 --- a/src/views/admin/permission/role/components/role-employee.vue +++ b/src/views/admin/permission/role/components/role-user.vue @@ -20,12 +20,12 @@ diff --git a/src/views/admin/permission/role/index.vue b/src/views/admin/permission/role/index.vue index 5b4f358..b457c90 100644 --- a/src/views/admin/permission/role/index.vue +++ b/src/views/admin/permission/role/index.vue @@ -29,7 +29,7 @@ - + @@ -62,13 +62,13 @@ /> - @@ -79,8 +79,8 @@ import CreateRole from '@/views/admin/permission/role/components/create-role.vue'; import EditRole from '@/views/admin/permission/role/components/edit-role.vue'; import { onMounted, reactive, ref } from 'vue'; - import RoleEmployee from '@/views/admin/permission/role/components/role-employee.vue'; import { listRoles, ListRolesReply } from '@/api/permission'; + import RoleUser from '@/views/admin/permission/role/components/role-user.vue'; const state = reactive({ createRole: { @@ -90,7 +90,7 @@ visible: false, roleCode: '', }, - editEmployee: { + editUser: { visible: false, roleCode: '', }, @@ -103,13 +103,13 @@ data.value = res.data; state.createRole.visible = false; state.editRole.visible = false; - state.editEmployee.visible = false; + state.editUser.visible = false; }); } - function editEmployeeOnClick(roleCode: string) { - state.editEmployee.visible = true; - state.editEmployee.roleCode = roleCode; + function editUserOnClick(roleCode: string) { + state.editUser.visible = true; + state.editUser.roleCode = roleCode; } function editRoleOnClick(roleCode: string) { diff --git a/src/views/admin/employee/components/create-department.vue b/src/views/admin/user/components/create-department.vue similarity index 96% rename from src/views/admin/employee/components/create-department.vue rename to src/views/admin/user/components/create-department.vue index 8ca104f..7c3d289 100644 --- a/src/views/admin/employee/components/create-department.vue +++ b/src/views/admin/user/components/create-department.vue @@ -46,9 +46,9 @@ import { createDepartment, CreateDepartmentRequest } from '@/api/department'; import { DepartmentOption, - EmployeeOption, + UserOption, getDepartmentOptions, - getEmployeeOptions, + getUserOptions, } from '@/api/common'; const prop = defineProps({ @@ -101,12 +101,12 @@ const state = reactive({ submitLoading: false }); const option = reactive({ - leaderOptions: [] as Array, + leaderOptions: [] as Array, parentOptions: [] as Array, }); function fetchLeaderOptions(likeName = '') { - return getEmployeeOptions({ likeName }).then((res) => { + return getUserOptions({ likeName }).then((res) => { option.leaderOptions = res.data.list; }); } diff --git a/src/views/admin/employee/components/create-employee.vue b/src/views/admin/user/components/create-user.vue similarity index 95% rename from src/views/admin/employee/components/create-employee.vue rename to src/views/admin/user/components/create-user.vue index 092d06f..b455e4d 100644 --- a/src/views/admin/employee/components/create-employee.vue +++ b/src/views/admin/user/components/create-user.vue @@ -66,8 +66,8 @@ diff --git a/src/views/admin/employee/components/search-employee-table.vue b/src/views/admin/user/components/search-user-table.vue similarity index 79% rename from src/views/admin/employee/components/search-employee-table.vue rename to src/views/admin/user/components/search-user-table.vue index aafd8a9..deb9a0d 100644 --- a/src/views/admin/employee/components/search-employee-table.vue +++ b/src/views/admin/user/components/search-user-table.vue @@ -57,7 +57,7 @@