Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
eryajf committed Jun 4, 2022
2 parents 03367b9 + 7fc53de commit b27eb9a
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 16 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,30 @@ server {
## 贡献者

<!-- readme: collaborators,contributors -start -->
<table>
<tr>
<td align="center">
<a href="https://github.com/eryajf">
<img src="https://avatars.githubusercontent.com/u/33259379?v=4" width="100;" alt="eryajf"/>
<br />
<sub><b>二丫讲梵</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/OTR37">
<img src="https://avatars.githubusercontent.com/u/51768167?v=4" width="100;" alt="OTR37"/>
<br />
<sub><b>OTR37</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/xinyuandd">
<img src="https://avatars.githubusercontent.com/u/3397848?v=4" width="100;" alt="xinyuandd"/>
<br />
<sub><b>Xinyuandd</b></sub>
</a>
</td></tr>
</table>
<!-- readme: collaborators,contributors -end -->


Expand Down
8 changes: 8 additions & 0 deletions src/api/personnel/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,11 @@ export function delGroup(data) {
data
})
}
// 同步钉钉部门信息
export function syncDingTalkDeptsApi(data) {
return request({
url: '/api/group/syncDingTalkDepts',
method: 'post',
data
})
}
11 changes: 9 additions & 2 deletions src/api/personnel/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function changePwd(data) {
})
}

// 创建用户(已完成)
// 创建用户(已完成)
export function createUser(data) {
return request({
url: '/api/user/add',
Expand All @@ -51,4 +51,11 @@ export function batchDeleteUserByIds(data) {
data
})
}

// 同步钉钉用户信息
export function syncDingTalkUsersApi(data) {
return request({
url: '/api/user/syncDingTalkUsers',
method: 'post',
data
})
}
30 changes: 17 additions & 13 deletions src/views/personnel/group/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
<el-form-item>
<el-button :disabled="multipleSelection.length === 0" :loading="loading" icon="el-icon-delete" type="danger" @click="batchDelete">批量删除</el-button>
</el-form-item>
<el-form-item>
<el-button :loading="loading" icon="el-icon-share" type="danger" @click="syncDingTalkDepts">同步钉钉部门</el-button>
</el-form-item>
</el-form>

<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">
Expand All @@ -43,18 +46,6 @@
</template>
</el-table-column>
</el-table>
<!--tree模式下取消分页选项
<el-pagination
:current-page="params.pageNum"
:page-size="params.pageSize"
:total="total"
:page-sizes="[1, 5, 10, 30]"
layout="total, prev, pager, next, sizes"
background
style="margin-top: 10px;float:right;margin-bottom: 10px;"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>-->
<!-- 新增 -->
<el-dialog :title="dialogFormTitle" :visible.sync="updateLoading">
<el-form ref="dialogForm" size="small" :model="dialogFormData" :rules="dialogFormRules" label-width="120px">
Expand Down Expand Up @@ -104,7 +95,7 @@
<script>
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { getGroupTree, groupAdd, groupUpdate, groupDel } from '@/api/personnel/group'
import { getGroupTree, groupAdd, groupUpdate, groupDel, syncDingTalkDeptsApi } from '@/api/personnel/group'
export default {
name: 'Group',
Expand Down Expand Up @@ -401,6 +392,19 @@ export default {
},
treeselectInput(value) {
this.treeselectValue = value
},
syncDingTalkDepts() {
this.loading = true
syncDingTalkDeptsApi().then(res => {
this.loading = false
this.getTableData()
this.$message({
showClose: true,
message: res.message,
type: 'success'
})
})
this.loading = false
}
}
}
Expand Down
23 changes: 22 additions & 1 deletion src/views/personnel/user/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
<el-form-item>
<el-button :disabled="multipleSelection.length === 0" :loading="loading" icon="el-icon-delete" type="danger" @click="batchDelete">批量删除</el-button>
</el-form-item>
<el-form-item>
<el-button :loading="loading" icon="el-icon-share" type="danger" @click="syncDingTalkUsers">同步钉钉用户信息</el-button>
</el-form-item>
</el-form>

<el-table v-loading="loading" :data="tableData" border stripe style="width: 100%" @selection-change="handleSelectionChange">
Expand Down Expand Up @@ -144,7 +147,11 @@
:options="departmentsOptions"
placeholder="请选择部门"
:normalizer="normalizer"
value-consists-of="ALL"
:multiple="true"
flat="true"
no-children-text="没有更多选项"
no-results-text="没有匹配的选项"
@input="treeselectInput"
@select="onOperatePersonChanged"
/>
Expand Down Expand Up @@ -176,7 +183,7 @@
import JSEncrypt from 'jsencrypt'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { getUsers, createUser, updateUserById, batchDeleteUserByIds } from '@/api/personnel/user'
import { getUsers, createUser, updateUserById, batchDeleteUserByIds, syncDingTalkUsersApi } from '@/api/personnel/user'
import { getRoles } from '@/api/system/role'
import { getGroupTree } from '@/api/personnel/group'
Expand Down Expand Up @@ -603,6 +610,7 @@ wLXapv+ZfsjG7NgdawIDAQAB
return {
id: node.ID,
label: node.groupType + '=' + node.groupName,
isDisabled: node.groupType === 'ou',
children: node.children
}
},
Expand All @@ -616,6 +624,19 @@ wLXapv+ZfsjG7NgdawIDAQAB
} else {
this.dialogFormData.departments = this.dialogFormData.departments + ',' + obj.groupName
}
},
syncDingTalkUsers(obj) {
this.loading = true
syncDingTalkUsersApi().then(res => {
this.loading = false
this.$message({
showClose: true,
message: res.message,
type: 'success'
})
})
this.getTableData()
this.loading = false
}
}
}
Expand Down

0 comments on commit b27eb9a

Please sign in to comment.