Commit 68c194b9 authored by sixiaofeng's avatar sixiaofeng

1

parent 2eb06b57
import Department from './moudles/Department'
import Enterprise from './moudles/Enterprise'
import Staff from './moudles/Staff'
import Account from './moudles/Account'
import Apply from './moudles/Apply'
export const service = {
staff: new Staff(),
enterprise: new Enterprise(),
department: new Department(),
account: new Account(),
apply: new Apply()
}
......
import BaseService from '../base'
// import { AcceptJoinDTO, GetSub } from './service.dto'
export default class Enterprise extends BaseService {
router= {
getBind:{ path:'/v1/account/get-bind',crediential:true}
}
constructor(){
super()
}
/**
* @param {AcceptJoinDTO} data {AcceptJoinDTO}
* @returns
*/
async getBind(){
return await this.useService(this.router.getBind)
}
}
import BaseService from '../base'
import { GetApplyDTO, JoinApplyDTO, QuitApplyDTO, SubmitJoinApplyDTO, SubmitQuitApplyDTO } from './service.dto'
export default class Enterprise extends BaseService {
router= {
getApply:{ path:'/v1/apply/get-applylist',crediential:true},
approvalJoin:{ path:'/v1/apply/join-apply-approval',crediential:true},
approvalQuit:{ path:'/v1/apply/quit-apply-approval',crediential:true},
submitJoin:{ path:'/v1/apply/submit-join-apply',crediential:true},
submitQuit:{ path:'/v1/apply/submit-quit-apply',crediential:true},
}
constructor(){
super()
}
/**
* 获取审批列表
* @param {GetApplyDTO} data {GetApplyDTO}
* @returns
*/
async getApply(data: GetApplyDTO){
return await this.useService(this.router.getApply, data)
}
/**
* 提交加入申请
* @param {JoinApplyDTO} data {JoinApplyDTO}
* @returns
*/
async approvalJoin(data: JoinApplyDTO){
return await this.useService(this.router.approvalJoin, data)
}
/**
* 提交退出申请
* @param {QuitApplyDTO} data {QuitApplyDTO}
* @returns
*/
async approvalQuit(data: QuitApplyDTO){
return await this.useService(this.router.approvalQuit, data)
}
/**
* 审批加入
* @param {SubmitJoinApplyDTO} data {SubmitJoinApplyDTO}
* @returns
*/
async submitJoin(data: SubmitJoinApplyDTO){
return await this.useService(this.router.submitJoin, data)
}
/**
* 审批退出
* @param {SubmitQuitApplyDTO} data {SubmitQuitApplyDTO}
* @returns
*/
async submitQuit(data: SubmitQuitApplyDTO){
return await this.useService(this.router.submitQuit, data)
}
}
import BaseService from '../base'
import { AcceptJoinDTO, GetSub } from './service.dto'
import { AddSubDTO, DeleteSubDTO, GetALLStaffDTO, GetStaffInfoDTO, GetSub, UpdateDepDTO } from './service.dto'
export default class Enterprise extends BaseService {
router= {
getsub:{ path:'/v1/department/get-sub-dep',crediential:true}
export default class Department extends BaseService {
router= {
getsub:{ path:'/v1/department/get-sub-dep',crediential:true},
addDep:{ path:'/v1/department/add-dep',crediential:true},
deleteDep:{ path:'/v1/department/delete-dep',crediential:true},
getAllStaff:{ path:'/v1/department/get-all-staffs',crediential:true},
getDep:{ path:'/v1/department/get-dep',crediential:true},
updateDep:{ path:'/v1/department/update-dep',crediential:true},
}
constructor(){
super()
}
/**
* @param {AcceptJoinDTO} data {AcceptJoinDTO}
* 获取子部门信息
* @param {GetSub} data {GetSub}
* @returns
*/
async getSub(data:GetSub){
return await this.useService(this.router.getsub,data)
return await this.useService(this.router.getsub,data)
}
/**
* 添加部门
* @param { AddSubDTO } data {AddSubDTO}
* @returns
*/
async addDep(data:AddSubDTO){
return await this.useService(this.router.addDep,data)
}
/**
* 删除部门
* @param { DeleteSubDTO } data {DeleteSubDTO}
* @returns
*/
async deleteDep(data:DeleteSubDTO){
return await this.useService(this.router.deleteDep,data)
}
/**
* 获取部门的全部员工
* @param { GetALLStaffDTO } data {GetALLStaffDTO}
* @returns
*/
async getAllStaff(data:GetALLStaffDTO){
return await this.useService(this.router.getAllStaff,data)
}
/**
* 获取部门基本信息
* @param { GetStaffInfoDTO } data {GetStaffInfoDTO}
* @returns
*/
async getDep(data:GetStaffInfoDTO){
return await this.useService(this.router.getDep,data)
}
/**
* 修改部门基本信息
* @param { UpdateDepDTO } data {UpdateDepDTO}
* @returns
*/
async updateDep(data:UpdateDepDTO){
return await this.useService(this.router.updateDep,data)
}
}
import BaseService from '../base'
import { AcceptJoinDTO } from './service.dto'
import { AcceptJoinDTO, CreateEnterpriseDTO, DeleteEnterpriseDTO, DeleteSubDTO, updateEnterpriseDTO, UpdateLeaderDTO } from './service.dto'
export default class Enterprise extends BaseService {
router= {
accept:{ path:'/v1/enterprise/accept-join',headers:[['df','1']]},
create:{ path:'/v1/enterprise/create'},
delete:{ path:'/v1/enterprise/delete'},
info:{ path:'/v1/enterprise/info'},
update:{ path:'/v1/enterprise/update'},
leader:{ path:'/v1/enterprise/update-leader'}
accept:{ path:'/v1/enterprise/accept-join', crediential: true,headers:[['df','1']]},
create:{ path:'/v1/enterprise/create', crediential: true},
delete:{ path:'/v1/enterprise/delete', crediential: true},
info:{ path:'/v1/enterprise/info', crediential: true},
update:{ path:'/v1/enterprise/update', crediential: true},
leader:{ path:'/v1/enterprise/update-leader', crediential: true}
}
constructor(){
super()
}
/**
* 员工接受团队邀请
* @param {AcceptJoinDTO} data {AcceptJoinDTO}
* @returns
*/
async acceptJoin(data:AcceptJoinDTO){
return await this.useService(this.router.accept,data)
}
/**
* 创建企业
* @param {CreateEnterpriseDTO} data {CreateEnterpriseDTO}
* @returns
*/
async create(data:CreateEnterpriseDTO){
return await this.useService(this.router.create,data)
}
/**
* 解散企业
* @param {DeleteEnterpriseDTO} data {DeleteEnterpriseDTO}
* @returns
*/
async deleteEnterprise(data:DeleteEnterpriseDTO){
return await this.useService(this.router.delete,data)
}
/**
* 获取企业信息
* @param {DeleteEnterpriseDTO} data {DeleteEnterpriseDTO}
* @returns
*/
async getEnterpriseInfo(data:DeleteEnterpriseDTO){
return await this.useService(this.router.info,data)
}
/**
* 更新企业信息
* @param {updateEnterpriseDTO} data {updateEnterpriseDTO}
* @returns
*/
async updateEnterprise(data:updateEnterpriseDTO){
return await this.useService(this.router.update,data)
}
/**
* 更新企业负责人
* @param {UpdateLeaderDTO} data {UpdateLeaderDTO}
* @returns
*/
async updateLeader(data:UpdateLeaderDTO){
return await this.useService(this.router.leader,data)
}
}
import BaseService from '../base'
import {ChangeDepDTO, ChangeRoleDTO, GetRroupDTO, GetStaffInfoDTO, ResignDTO, UpdateStaffDTO} from './service.dto'
export default class Staff extends BaseService {
router = {
accept:{ path:'/v1/enterprise/accept-join'},
create:{ path:'/v1/enterprise/create'},
delete:{ path:'/v1/enterprise/delete'},
info:{ path:'/v1/enterprise/info'},
update:{ path:'/v1/enterprise/update'},
leader:{ path:'/v1/enterprise/update-leader'}
router = {
changeDep:{ path:'/v1/staff/change-dep', crediential: true},
changeRole:{ path:'/v1/staff/change-role', crediential: true},
getGroup:{ path:'/v1/staff/get-group', crediential: true},
getInfo:{ path:'/v1/staff/get-staff', crediential: true},
resign:{ path:'/v1/staff/resign', crediential: true},
updateInfo:{ path:'/v1/staff/update-staff-info', crediential: true},
}
constructor(){
super()
}
/**
* 变更员工部门
* @param {ChangeDepDTO} data {ChangeDepDTO}
* @returns
*/
async changeDep(data:ChangeDepDTO){
return await this.useService(this.router.changeDep,data)
}
/**
* 设置取消管理员
* @param {ChangeRoleDTO}} data {ChangeRoleDTO}
* @returns
*/
async changeRole(data:ChangeRoleDTO){
return await this.useService(this.router.changeRole,data)
}
/**
* 查询员工加入的群
* @param {GetRroupDTO}} data {GetRroupDTO}
* @returns
*/
async getRroup(data:GetRroupDTO){
return await this.useService(this.router.getGroup,data)
}
/**
* 获取员工信息
* @param {GetStaffInfoDTO}} data {GetRroupDTO}
* @returns
*/
async getInfo(data:GetStaffInfoDTO){
return await this.useService(this.router.getInfo,data)
}
/**
* 办理离职人员
* @param {ResignDTO} data {ResignDTO}
* @returns
*/
async resign(data:ResignDTO){
return await this.useService(this.router.resign,data)
}
/**
* 更新员工信息
* @param {UpdateStaffDTO} data {UpdateStaffDTO}
* @returns
*/
async updateInfo(data:UpdateStaffDTO){
return await this.useService(this.router.updateInfo,data)
}
}
// 企业
export interface AcceptJoinDTO{
"expiration": number,
"inviterId": string,
"name": string,
"oaServer": string,
"depId": string,
"entId": string,
"hash": string,
"joinTime": number,
"phone": string,
"position": string
}
"expiration": number,
"inviterId": string,
"name": string,
"oaServer": string,
"depId": string,
"entId": string,
"hash": string,
"joinTime": number,
"phone": string,
"position": string
}
export interface CreateEnterpriseDTO {
leaderName: string,
name: string,
nodeServer: string,
oaServer: string,
imServer: string
}
export interface DeleteEnterpriseDTO {
id: string
}
export interface updateEnterpriseDTO {
avator: string,
description: string,
id: string,
name: string
}
export interface UpdateLeaderDTO {
id: string,
newLeaderId: string
}
// 部门
export interface GetSub{
"entId": string,
"hasStaff"?: boolean,
"isDirect"?: boolean,
"parentId": string
}
export interface AddSubDTO{
"entId": string,
"leaderId": string,
"name": string,
"parentId": string
}
export interface DeleteSubDTO{
"entId": string,
"id": string
}
export interface GetALLStaffDTO{
"entId": string,
"id": string,
"isDirect"?: boolean
}
export interface GetDepDTO {
"entId": string,
"id": string
}
export interface UpdateDepDTO {
"name": string,
"parentId": string,
"entId": string,
"id": string,
"leaderId": string
}
// 员工
export interface ChangeDepDTO {
"depId": string,
"entId": string,
"ids": Array<string>
}
export interface ChangeRoleDTO {
"id": string,
"role": 1 | 2 | 3, // 1:超级管理员;2:客户管理员;3:普通人员
"entId": string
}
export interface GetRroupDTO {
"entId": string
}
export interface GetStaffInfoDTO {
"entId": string,
"id": string
}
export interface ResignDTO {
"entId": string,
"id": string
}
export interface UpdateStaffDTO {
"depId": string,
"email": string,
"phone": string,
"position": string,
"entId": string,
"jionTime": number,
"leaderId": string,
"name": string,
"workplace"?: string
}
// 审核
export interface GetApplyDTO {
"entId": string,
"limit": number,
"offset": number
}
export interface JoinApplyDTO {
"applyId": string,
"depId": string,
"fromName": string,
"joinTime": number,
"phone": string,
"position": string,
"status": 1 | 2
}
export interface QuitApplyDTO {
"applyId": string,
"status": 1 | 2
}
export interface SubmitJoinApplyDTO {
"code": string,
"entId": string,
"phone": string,
"reason"?: string,
"types"?: number,
"userName": string
}
export interface SubmitQuitApplyDTO {
"entId": string,
"userName": string
}
// 账户
// export interface GetBindDTO {
// }
\ No newline at end of file
import Vue from 'vue'
import Vuex from 'vuex'
// import { EnterpriseInfo } from './store.dto'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
enterpriseInfo: undefined
},
mutations: {
setEnterpriseInfo(state, payload) {
state.enterpriseInfo = payload
}
},
actions: {
},
......
export interface EnterpriseInfo {
"oaServer": string,
"avatar": string,
"description": string,
"id": string,
"imServer": string,
"name": string,
"nodeServer": string
}
\ No newline at end of file
......@@ -21,7 +21,7 @@
</template>
<div class="px-4 pt-14">
<!-- 头部 -->
<div class="flex items-start pt-1 pb-5">
<div class="flex items-center pt-1 pb-5">
<app-icon
type="png"
:path="require('@/assets/icons/team-icon.png')"
......@@ -30,12 +30,12 @@
<!-- 名称 -->
<div class="ml-4 flex-1 text-text-primary">
<span class="break-all">
{{ teamName }}
{{ enterpriseInfo.name }}
</span>
<!-- 团队号 -->
<div class="text-text-secondary text-sm font-medium mt-1.5">
<!-- <div class="text-text-secondary text-sm font-medium mt-1.5">
团队号 ABCDE1234
</div>
</div> -->
</div>
</div>
<c-cell dot title="团队架构" @click="$router.push('/team/team-frame')" />
......@@ -66,23 +66,17 @@ export default Vue.extend({
name: 'TeamManagement',
data() {
return {
teamName: '企业名称',
enterpriseInfo: {}
}
},
mounted(){
this.$service.enterprise.acceptJoin({
"expiration": 1,
"inviterId": "inviterId",
"name": "name",
"oaServer": "oaServer",
"depId": "depId",
"entId": "entId",
"hash": "hash",
"joinTime": 1,
"phone": "phone",
"position": "position"
}
)
this.$service.enterprise.getEnterpriseInfo({
id: '166910771849072640'
}).then((res: any)=> {
const {data} = res
this.enterpriseInfo = data.data
this.$store.commit('setEnterpriseInfo', data.data)
})
},
methods: {
editTeamName() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment