Skip to content

Commit b27eb9a

Browse files
committed
2 parents 03367b9 + 7fc53de commit b27eb9a

File tree

5 files changed

+80
-16
lines changed

5 files changed

+80
-16
lines changed

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,30 @@ server {
212212
## 贡献者
213213

214214
<!-- readme: collaborators,contributors -start -->
215+
<table>
216+
<tr>
217+
<td align="center">
218+
<a href="https://github.com/eryajf">
219+
<img src="https://avatars.githubusercontent.com/u/33259379?v=4" width="100;" alt="eryajf"/>
220+
<br />
221+
<sub><b>二丫讲梵</b></sub>
222+
</a>
223+
</td>
224+
<td align="center">
225+
<a href="https://github.com/OTR37">
226+
<img src="https://avatars.githubusercontent.com/u/51768167?v=4" width="100;" alt="OTR37"/>
227+
<br />
228+
<sub><b>OTR37</b></sub>
229+
</a>
230+
</td>
231+
<td align="center">
232+
<a href="https://github.com/xinyuandd">
233+
<img src="https://avatars.githubusercontent.com/u/3397848?v=4" width="100;" alt="xinyuandd"/>
234+
<br />
235+
<sub><b>Xinyuandd</b></sub>
236+
</a>
237+
</td></tr>
238+
</table>
215239
<!-- readme: collaborators,contributors -end -->
216240

217241

src/api/personnel/group.js

+8
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,11 @@ export function delGroup(data) {
7272
data
7373
})
7474
}
75+
// 同步钉钉部门信息
76+
export function syncDingTalkDeptsApi(data) {
77+
return request({
78+
url: '/api/group/syncDingTalkDepts',
79+
method: 'post',
80+
data
81+
})
82+
}

src/api/personnel/user.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function changePwd(data) {
2626
})
2727
}
2828

29-
// 创建用户(已完成)
29+
// 创建用户(已完成)
3030
export function createUser(data) {
3131
return request({
3232
url: '/api/user/add',
@@ -51,4 +51,11 @@ export function batchDeleteUserByIds(data) {
5151
data
5252
})
5353
}
54-
54+
// 同步钉钉用户信息
55+
export function syncDingTalkUsersApi(data) {
56+
return request({
57+
url: '/api/user/syncDingTalkUsers',
58+
method: 'post',
59+
data
60+
})
61+
}

src/views/personnel/group/index.vue

+17-13
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
<el-form-item>
2121
<el-button :disabled="multipleSelection.length === 0" :loading="loading" icon="el-icon-delete" type="danger" @click="batchDelete">批量删除</el-button>
2222
</el-form-item>
23+
<el-form-item>
24+
<el-button :loading="loading" icon="el-icon-share" type="danger" @click="syncDingTalkDepts">同步钉钉部门</el-button>
25+
</el-form-item>
2326
</el-form>
2427

2528
<el-table v-loading="loading" :default-expand-all="true" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" row-key="ID" :data="infoTableData" border stripe style="width: 100%" @selection-change="handleSelectionChange">
@@ -43,18 +46,6 @@
4346
</template>
4447
</el-table-column>
4548
</el-table>
46-
<!--tree模式下取消分页选项
47-
<el-pagination
48-
:current-page="params.pageNum"
49-
:page-size="params.pageSize"
50-
:total="total"
51-
:page-sizes="[1, 5, 10, 30]"
52-
layout="total, prev, pager, next, sizes"
53-
background
54-
style="margin-top: 10px;float:right;margin-bottom: 10px;"
55-
@size-change="handleSizeChange"
56-
@current-change="handleCurrentChange"
57-
/>-->
5849
<!-- 新增 -->
5950
<el-dialog :title="dialogFormTitle" :visible.sync="updateLoading">
6051
<el-form ref="dialogForm" size="small" :model="dialogFormData" :rules="dialogFormRules" label-width="120px">
@@ -104,7 +95,7 @@
10495
<script>
10596
import Treeselect from '@riophae/vue-treeselect'
10697
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
107-
import { getGroupTree, groupAdd, groupUpdate, groupDel } from '@/api/personnel/group'
98+
import { getGroupTree, groupAdd, groupUpdate, groupDel, syncDingTalkDeptsApi } from '@/api/personnel/group'
10899
109100
export default {
110101
name: 'Group',
@@ -401,6 +392,19 @@ export default {
401392
},
402393
treeselectInput(value) {
403394
this.treeselectValue = value
395+
},
396+
syncDingTalkDepts() {
397+
this.loading = true
398+
syncDingTalkDeptsApi().then(res => {
399+
this.loading = false
400+
this.getTableData()
401+
this.$message({
402+
showClose: true,
403+
message: res.message,
404+
type: 'success'
405+
})
406+
})
407+
this.loading = false
404408
}
405409
}
406410
}

src/views/personnel/user/index.vue

+22-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
<el-form-item>
2727
<el-button :disabled="multipleSelection.length === 0" :loading="loading" icon="el-icon-delete" type="danger" @click="batchDelete">批量删除</el-button>
2828
</el-form-item>
29+
<el-form-item>
30+
<el-button :loading="loading" icon="el-icon-share" type="danger" @click="syncDingTalkUsers">同步钉钉用户信息</el-button>
31+
</el-form-item>
2932
</el-form>
3033

3134
<el-table v-loading="loading" :data="tableData" border stripe style="width: 100%" @selection-change="handleSelectionChange">
@@ -144,7 +147,11 @@
144147
:options="departmentsOptions"
145148
placeholder="请选择部门"
146149
:normalizer="normalizer"
150+
value-consists-of="ALL"
147151
:multiple="true"
152+
flat="true"
153+
no-children-text="没有更多选项"
154+
no-results-text="没有匹配的选项"
148155
@input="treeselectInput"
149156
@select="onOperatePersonChanged"
150157
/>
@@ -176,7 +183,7 @@
176183
import JSEncrypt from 'jsencrypt'
177184
import Treeselect from '@riophae/vue-treeselect'
178185
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
179-
import { getUsers, createUser, updateUserById, batchDeleteUserByIds } from '@/api/personnel/user'
186+
import { getUsers, createUser, updateUserById, batchDeleteUserByIds, syncDingTalkUsersApi } from '@/api/personnel/user'
180187
import { getRoles } from '@/api/system/role'
181188
import { getGroupTree } from '@/api/personnel/group'
182189
@@ -603,6 +610,7 @@ wLXapv+ZfsjG7NgdawIDAQAB
603610
return {
604611
id: node.ID,
605612
label: node.groupType + '=' + node.groupName,
613+
isDisabled: node.groupType === 'ou',
606614
children: node.children
607615
}
608616
},
@@ -616,6 +624,19 @@ wLXapv+ZfsjG7NgdawIDAQAB
616624
} else {
617625
this.dialogFormData.departments = this.dialogFormData.departments + ',' + obj.groupName
618626
}
627+
},
628+
syncDingTalkUsers(obj) {
629+
this.loading = true
630+
syncDingTalkUsersApi().then(res => {
631+
this.loading = false
632+
this.$message({
633+
showClose: true,
634+
message: res.message,
635+
type: 'success'
636+
})
637+
})
638+
this.getTableData()
639+
this.loading = false
619640
}
620641
}
621642
}

0 commit comments

Comments
 (0)