Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
18 changes: 17 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 @@ -176,7 +179,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 @@ -616,6 +619,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