Skip to content

Commit a305da7

Browse files
authored
feat: 添加导入原来openldap数据的能力 (#13)
1 parent 76441ac commit a305da7

File tree

4 files changed

+53
-3
lines changed

4 files changed

+53
-3
lines changed

src/api/personnel/group.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,20 @@ export function syncWeComDeptsApi(data) {
9090
})
9191
}
9292

93-
// 同步企业微信部门信息
93+
// 同步飞书部门信息
9494
export function syncFeiShuDeptsApi(data) {
9595
return request({
9696
url: '/api/group/syncFeiShuDepts',
9797
method: 'post',
9898
data
9999
})
100100
}
101+
102+
// 同步openldap部门信息
103+
export function syncOpenLdapDeptsApi(data) {
104+
return request({
105+
url: '/api/group/syncOpenLdapDepts',
106+
method: 'post',
107+
data
108+
})
109+
}

src/api/personnel/user.js

+9
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,12 @@ export function syncFeiShuUsersApi(data) {
7777
data
7878
})
7979
}
80+
81+
// 同步openldap用户信息
82+
export function syncOpenLdapUsersApi(data) {
83+
return request({
84+
url: '/api/user/syncOpenLdapUsers',
85+
method: 'post',
86+
data
87+
})
88+
}

src/views/personnel/group/index.vue

+17-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
<el-button :disabled="multipleSelection.length === 0" :loading="loading" icon="el-icon-delete" type="danger" @click="batchDelete">批量删除</el-button>
2222
</el-form-item>
2323
<br>
24+
<el-form-item>
25+
<el-button :loading="loading" icon="el-icon-share" type="danger" @click="syncOpenLdapDepts">同步原ldap部门</el-button>
26+
</el-form-item>
2427
<el-form-item>
2528
<el-button :loading="loading" icon="el-icon-share" type="danger" @click="syncDingTalkDepts">同步钉钉部门</el-button>
2629
</el-form-item>
@@ -103,7 +106,7 @@
103106
<script>
104107
import Treeselect from '@riophae/vue-treeselect'
105108
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
106-
import { getGroupTree, groupAdd, groupUpdate, groupDel, syncDingTalkDeptsApi, syncWeComDeptsApi, syncFeiShuDeptsApi } from '@/api/personnel/group'
109+
import { getGroupTree, groupAdd, groupUpdate, groupDel, syncDingTalkDeptsApi, syncWeComDeptsApi, syncFeiShuDeptsApi, syncOpenLdapDeptsApi } from '@/api/personnel/group'
107110
108111
export default {
109112
name: 'Group',
@@ -440,6 +443,19 @@ export default {
440443
})
441444
this.loading = false
442445
},
446+
syncOpenLdapDepts() {
447+
this.loading = true
448+
syncOpenLdapDeptsApi().then(res => {
449+
this.loading = false
450+
this.getTableData()
451+
this.$message({
452+
showClose: true,
453+
message: res.message,
454+
type: 'success'
455+
})
456+
})
457+
this.loading = false
458+
},
443459
}
444460
}
445461
</script>

src/views/personnel/user/index.vue

+17-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
<el-button :disabled="multipleSelection.length === 0" :loading="loading" icon="el-icon-delete" type="danger" @click="batchDelete">批量删除</el-button>
2828
</el-form-item>
2929
<br>
30+
<el-form-item>
31+
<el-button :loading="loading" icon="el-icon-share" type="danger" @click="syncOpenLdapUsers">同步原ldap用户信息</el-button>
32+
</el-form-item>
3033
<el-form-item>
3134
<el-button :loading="loading" icon="el-icon-share" type="danger" @click="syncDingTalkUsers">同步钉钉用户信息</el-button>
3235
</el-form-item>
@@ -191,7 +194,7 @@
191194
import JSEncrypt from 'jsencrypt'
192195
import Treeselect from '@riophae/vue-treeselect'
193196
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
194-
import { getUsers, createUser, updateUserById, batchDeleteUserByIds, syncDingTalkUsersApi, syncWeComUsersApi, syncFeiShuUsersApi } from '@/api/personnel/user'
197+
import { getUsers, createUser, updateUserById, batchDeleteUserByIds, syncDingTalkUsersApi, syncWeComUsersApi, syncFeiShuUsersApi, syncOpenLdapUsersApi } from '@/api/personnel/user'
195198
import { getRoles } from '@/api/system/role'
196199
import { getGroupTree } from '@/api/personnel/group'
197200
@@ -672,6 +675,19 @@ wLXapv+ZfsjG7NgdawIDAQAB
672675
this.getTableData()
673676
this.loading = false
674677
},
678+
syncOpenLdapUsers(obj) {
679+
this.loading = true
680+
syncOpenLdapUsersApi().then(res => {
681+
this.loading = false
682+
this.$message({
683+
showClose: true,
684+
message: res.message,
685+
type: 'success'
686+
})
687+
})
688+
this.getTableData()
689+
this.loading = false
690+
},
675691
}
676692
}
677693
</script>

0 commit comments

Comments
 (0)